//! 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"
))]
unsafe impl NSAccessibility for NSPathControl {}

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

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

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

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

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

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

#[cfg(all(
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSUserInterfaceItemIdentification",
    feature = "NSView"
))]
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 unsafe fn isEditable(&self) -> bool;

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

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

        /// Setter for [`allowedTypes`][Self::allowedTypes].
        #[unsafe(method(setAllowedTypes:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAllowedTypes(&self, allowed_types: Option<&NSArray<NSString>>);

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

        /// Setter for [`placeholderString`][Self::placeholderString].
        #[unsafe(method(setPlaceholderString:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPlaceholderString(&self, placeholder_string: Option<&NSString>);

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

        /// Setter for [`placeholderAttributedString`][Self::placeholderAttributedString].
        #[unsafe(method(setPlaceholderAttributedString:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPlaceholderAttributedString(
            &self,
            placeholder_attributed_string: Option<&NSAttributedString>,
        );

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

        /// Setter for [`URL`][Self::URL].
        #[unsafe(method(setURL:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setURL(&self, url: Option<&NSURL>);

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

        /// Setter for [`doubleAction`][Self::doubleAction].
        #[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 unsafe fn pathStyle(&self) -> NSPathStyle;

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

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

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

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

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

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

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

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

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

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

        #[cfg(feature = "NSMenu")]
        /// Setter for [`menu`][Self::menu].
        #[unsafe(method(setMenu:))]
        #[unsafe(method_family = none)]
        pub unsafe 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 unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;

        #[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 unsafe 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 unsafe 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)]
        unsafe 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)]
        unsafe 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)]
        unsafe 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)]
        unsafe 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)]
        unsafe 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)]
        unsafe 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 unsafe 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 unsafe 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 unsafe fn setPathComponentCells(&self, cells: &NSArray<NSPathComponentCell>);
    );
}
