//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspathcontrol?language=objc)
    #[unsafe(super(NSControl, NSView, NSResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
    pub struct NSPathControl;
);

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSAccessibility for NSPathControl {}
);

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSAccessibilityElementProtocol for NSPathControl {}
);

#[cfg(all(
    feature = "NSAnimation",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSAnimatablePropertyContainer for NSPathControl {}
);

#[cfg(all(
    feature = "NSAppearance",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSAppearanceCustomization for NSPathControl {}
);

#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
    unsafe impl NSCoding for NSPathControl {}
);

#[cfg(all(
    feature = "NSControl",
    feature = "NSDragging",
    feature = "NSResponder",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSDraggingDestination for NSPathControl {}
);

#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for NSPathControl {}
);

#[cfg(all(
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSUserInterfaceItemIdentification",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSUserInterfaceItemIdentification for NSPathControl {}
);

#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
impl NSPathControl {
    extern_methods!(
        #[unsafe(method(isEditable))]
        #[unsafe(method_family = none)]
        pub fn isEditable(&self) -> bool;

        /// Setter for [`isEditable`][Self::isEditable].
        #[unsafe(method(setEditable:))]
        #[unsafe(method_family = none)]
        pub fn setEditable(&self, editable: bool);

        #[unsafe(method(allowedTypes))]
        #[unsafe(method_family = none)]
        pub fn allowedTypes(&self) -> Option<Retained<NSArray<NSString>>>;

        /// Setter for [`allowedTypes`][Self::allowedTypes].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAllowedTypes:))]
        #[unsafe(method_family = none)]
        pub fn setAllowedTypes(&self, allowed_types: Option<&NSArray<NSString>>);

        #[unsafe(method(placeholderString))]
        #[unsafe(method_family = none)]
        pub fn placeholderString(&self) -> Option<Retained<NSString>>;

        /// Setter for [`placeholderString`][Self::placeholderString].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setPlaceholderString:))]
        #[unsafe(method_family = none)]
        pub fn setPlaceholderString(&self, placeholder_string: Option<&NSString>);

        #[unsafe(method(placeholderAttributedString))]
        #[unsafe(method_family = none)]
        pub fn placeholderAttributedString(&self) -> Option<Retained<NSAttributedString>>;

        /// Setter for [`placeholderAttributedString`][Self::placeholderAttributedString].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setPlaceholderAttributedString:))]
        #[unsafe(method_family = none)]
        pub fn setPlaceholderAttributedString(
            &self,
            placeholder_attributed_string: Option<&NSAttributedString>,
        );

        #[unsafe(method(URL))]
        #[unsafe(method_family = none)]
        pub fn URL(&self) -> Option<Retained<NSURL>>;

        /// Setter for [`URL`][Self::URL].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setURL:))]
        #[unsafe(method_family = none)]
        pub fn setURL(&self, url: Option<&NSURL>);

        #[unsafe(method(doubleAction))]
        #[unsafe(method_family = none)]
        pub fn doubleAction(&self) -> Option<Sel>;

        /// Setter for [`doubleAction`][Self::doubleAction].
        ///
        /// # Safety
        ///
        /// `double_action` must be a valid selector.
        #[unsafe(method(setDoubleAction:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDoubleAction(&self, double_action: Option<Sel>);

        #[cfg(feature = "NSPathCell")]
        #[unsafe(method(pathStyle))]
        #[unsafe(method_family = none)]
        pub fn pathStyle(&self) -> NSPathStyle;

        #[cfg(feature = "NSPathCell")]
        /// Setter for [`pathStyle`][Self::pathStyle].
        #[unsafe(method(setPathStyle:))]
        #[unsafe(method_family = none)]
        pub fn setPathStyle(&self, path_style: NSPathStyle);

        #[cfg(feature = "NSPathControlItem")]
        #[unsafe(method(clickedPathItem))]
        #[unsafe(method_family = none)]
        pub fn clickedPathItem(&self) -> Option<Retained<NSPathControlItem>>;

        #[cfg(feature = "NSPathControlItem")]
        #[unsafe(method(pathItems))]
        #[unsafe(method_family = none)]
        pub fn pathItems(&self) -> Retained<NSArray<NSPathControlItem>>;

        #[cfg(feature = "NSPathControlItem")]
        /// Setter for [`pathItems`][Self::pathItems].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setPathItems:))]
        #[unsafe(method_family = none)]
        pub fn setPathItems(&self, path_items: &NSArray<NSPathControlItem>);

        #[cfg(feature = "NSColor")]
        #[unsafe(method(backgroundColor))]
        #[unsafe(method_family = none)]
        pub fn backgroundColor(&self) -> Option<Retained<NSColor>>;

        #[cfg(feature = "NSColor")]
        /// Setter for [`backgroundColor`][Self::backgroundColor].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setBackgroundColor:))]
        #[unsafe(method_family = none)]
        pub fn setBackgroundColor(&self, background_color: Option<&NSColor>);

        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NSPathControlDelegate>>>;

        /// Setter for [`delegate`][Self::delegate].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NSPathControlDelegate>>);

        #[cfg(feature = "NSDragging")]
        #[unsafe(method(setDraggingSourceOperationMask:forLocal:))]
        #[unsafe(method_family = none)]
        pub fn setDraggingSourceOperationMask_forLocal(
            &self,
            mask: NSDragOperation,
            is_local: bool,
        );

        #[cfg(feature = "NSMenu")]
        #[unsafe(method(menu))]
        #[unsafe(method_family = none)]
        pub fn menu(&self) -> Option<Retained<NSMenu>>;

        #[cfg(feature = "NSMenu")]
        /// Setter for [`menu`][Self::menu].
        #[unsafe(method(setMenu:))]
        #[unsafe(method_family = none)]
        pub fn setMenu(&self, menu: Option<&NSMenu>);
    );
}

/// Methods declared on superclass `NSControl`.
#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
impl NSPathControl {
    extern_methods!(
        #[unsafe(method(initWithFrame:))]
        #[unsafe(method_family = init)]
        pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;
    );
}

/// Methods declared on superclass `NSResponder`.
#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
impl NSPathControl {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
impl NSPathControl {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspathcontroldelegate?language=objc)
    pub unsafe trait NSPathControlDelegate: NSObjectProtocol + MainThreadOnly {
        #[cfg(all(
            feature = "NSControl",
            feature = "NSPasteboard",
            feature = "NSPathControlItem",
            feature = "NSResponder",
            feature = "NSView"
        ))]
        #[optional]
        #[unsafe(method(pathControl:shouldDragItem:withPasteboard:))]
        #[unsafe(method_family = none)]
        fn pathControl_shouldDragItem_withPasteboard(
            &self,
            path_control: &NSPathControl,
            path_item: &NSPathControlItem,
            pasteboard: &NSPasteboard,
        ) -> bool;

        #[cfg(all(
            feature = "NSActionCell",
            feature = "NSCell",
            feature = "NSControl",
            feature = "NSPasteboard",
            feature = "NSPathComponentCell",
            feature = "NSResponder",
            feature = "NSTextFieldCell",
            feature = "NSView"
        ))]
        #[optional]
        #[unsafe(method(pathControl:shouldDragPathComponentCell:withPasteboard:))]
        #[unsafe(method_family = none)]
        fn pathControl_shouldDragPathComponentCell_withPasteboard(
            &self,
            path_control: &NSPathControl,
            path_component_cell: &NSPathComponentCell,
            pasteboard: &NSPasteboard,
        ) -> bool;

        #[cfg(all(
            feature = "NSControl",
            feature = "NSDragging",
            feature = "NSResponder",
            feature = "NSView"
        ))]
        #[optional]
        #[unsafe(method(pathControl:validateDrop:))]
        #[unsafe(method_family = none)]
        fn pathControl_validateDrop(
            &self,
            path_control: &NSPathControl,
            info: &ProtocolObject<dyn NSDraggingInfo>,
        ) -> NSDragOperation;

        #[cfg(all(
            feature = "NSControl",
            feature = "NSDragging",
            feature = "NSResponder",
            feature = "NSView"
        ))]
        #[optional]
        #[unsafe(method(pathControl:acceptDrop:))]
        #[unsafe(method_family = none)]
        fn pathControl_acceptDrop(
            &self,
            path_control: &NSPathControl,
            info: &ProtocolObject<dyn NSDraggingInfo>,
        ) -> bool;

        #[cfg(all(
            feature = "NSControl",
            feature = "NSOpenPanel",
            feature = "NSPanel",
            feature = "NSResponder",
            feature = "NSSavePanel",
            feature = "NSView",
            feature = "NSWindow"
        ))]
        #[optional]
        #[unsafe(method(pathControl:willDisplayOpenPanel:))]
        #[unsafe(method_family = none)]
        fn pathControl_willDisplayOpenPanel(
            &self,
            path_control: &NSPathControl,
            open_panel: &NSOpenPanel,
        );

        #[cfg(all(
            feature = "NSControl",
            feature = "NSMenu",
            feature = "NSResponder",
            feature = "NSView"
        ))]
        #[optional]
        #[unsafe(method(pathControl:willPopUpMenu:))]
        #[unsafe(method_family = none)]
        fn pathControl_willPopUpMenu(&self, path_control: &NSPathControl, menu: &NSMenu);
    }
);

/// NSDeprecated.
#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
impl NSPathControl {
    extern_methods!(
        #[cfg(all(
            feature = "NSActionCell",
            feature = "NSCell",
            feature = "NSPathComponentCell",
            feature = "NSTextFieldCell"
        ))]
        #[deprecated = "Use the clickedPathItem property instead"]
        #[unsafe(method(clickedPathComponentCell))]
        #[unsafe(method_family = none)]
        pub fn clickedPathComponentCell(&self) -> Option<Retained<NSPathComponentCell>>;

        #[cfg(all(
            feature = "NSActionCell",
            feature = "NSCell",
            feature = "NSPathComponentCell",
            feature = "NSTextFieldCell"
        ))]
        #[deprecated = "Use the pathItems property instead"]
        #[unsafe(method(pathComponentCells))]
        #[unsafe(method_family = none)]
        pub fn pathComponentCells(&self) -> Retained<NSArray<NSPathComponentCell>>;

        #[cfg(all(
            feature = "NSActionCell",
            feature = "NSCell",
            feature = "NSPathComponentCell",
            feature = "NSTextFieldCell"
        ))]
        #[deprecated = "Use the pathItems property instead"]
        #[unsafe(method(setPathComponentCells:))]
        #[unsafe(method_family = none)]
        pub fn setPathComponentCells(&self, cells: &NSArray<NSPathComponentCell>);
    );
}
