//! 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::*;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspathstyle?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSPathStyle(pub NSInteger);
impl NSPathStyle {
    #[doc(alias = "NSPathStyleStandard")]
    pub const Standard: Self = Self(0);
    #[doc(alias = "NSPathStylePopUp")]
    pub const PopUp: Self = Self(2);
    #[deprecated]
    #[doc(alias = "NSPathStyleNavigationBar")]
    pub const NavigationBar: Self = Self(1);
}

unsafe impl Encode for NSPathStyle {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSPathStyle {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

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

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSActionCell",
    feature = "NSCell"
))]
unsafe impl NSAccessibility for NSPathCell {}

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSActionCell",
    feature = "NSCell"
))]
unsafe impl NSAccessibilityElementProtocol for NSPathCell {}

#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
unsafe impl NSCoding for NSPathCell {}

#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
unsafe impl NSCopying for NSPathCell {}

#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
unsafe impl CopyingHelper for NSPathCell {
    type Result = Self;
}

#[cfg(all(feature = "NSActionCell", feature = "NSCell", feature = "NSMenu"))]
unsafe impl NSMenuItemValidation for NSPathCell {}

#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
unsafe impl NSObjectProtocol for NSPathCell {}

#[cfg(all(feature = "NSActionCell", feature = "NSCell", feature = "NSSavePanel"))]
unsafe impl NSOpenSavePanelDelegate for NSPathCell {}

#[cfg(all(
    feature = "NSActionCell",
    feature = "NSCell",
    feature = "NSUserInterfaceItemIdentification"
))]
unsafe impl NSUserInterfaceItemIdentification for NSPathCell {}

#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
impl NSPathCell {
    extern_methods!(
        #[unsafe(method(pathStyle))]
        #[unsafe(method_family = none)]
        pub unsafe fn pathStyle(&self) -> NSPathStyle;

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

        #[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(setObjectValue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setObjectValue(&self, obj: Option<&ProtocolObject<dyn NSCopying>>);

        #[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(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NSPathCellDelegate>>>;

        /// 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 NSPathCellDelegate>>);

        #[unsafe(method(pathComponentCellClass))]
        #[unsafe(method_family = none)]
        pub unsafe fn pathComponentCellClass(mtm: MainThreadMarker) -> &'static AnyClass;

        #[cfg(all(feature = "NSPathComponentCell", feature = "NSTextFieldCell"))]
        #[unsafe(method(pathComponentCells))]
        #[unsafe(method_family = none)]
        pub unsafe fn pathComponentCells(&self) -> Retained<NSArray<NSPathComponentCell>>;

        #[cfg(all(feature = "NSPathComponentCell", feature = "NSTextFieldCell"))]
        /// Setter for [`pathComponentCells`][Self::pathComponentCells].
        #[unsafe(method(setPathComponentCells:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPathComponentCells(
            &self,
            path_component_cells: &NSArray<NSPathComponentCell>,
        );

        #[cfg(all(
            feature = "NSPathComponentCell",
            feature = "NSResponder",
            feature = "NSTextFieldCell",
            feature = "NSView"
        ))]
        #[unsafe(method(rectOfPathComponentCell:withFrame:inView:))]
        #[unsafe(method_family = none)]
        pub unsafe fn rectOfPathComponentCell_withFrame_inView(
            &self,
            cell: &NSPathComponentCell,
            frame: NSRect,
            view: &NSView,
        ) -> NSRect;

        #[cfg(all(
            feature = "NSPathComponentCell",
            feature = "NSResponder",
            feature = "NSTextFieldCell",
            feature = "NSView"
        ))]
        #[unsafe(method(pathComponentCellAtPoint:withFrame:inView:))]
        #[unsafe(method_family = none)]
        pub unsafe fn pathComponentCellAtPoint_withFrame_inView(
            &self,
            point: NSPoint,
            frame: NSRect,
            view: &NSView,
        ) -> Option<Retained<NSPathComponentCell>>;

        #[cfg(all(feature = "NSPathComponentCell", feature = "NSTextFieldCell"))]
        #[unsafe(method(clickedPathComponentCell))]
        #[unsafe(method_family = none)]
        pub unsafe fn clickedPathComponentCell(&self) -> Option<Retained<NSPathComponentCell>>;

        #[cfg(all(feature = "NSEvent", feature = "NSResponder", feature = "NSView"))]
        #[unsafe(method(mouseEntered:withFrame:inView:))]
        #[unsafe(method_family = none)]
        pub unsafe fn mouseEntered_withFrame_inView(
            &self,
            event: &NSEvent,
            frame: NSRect,
            view: &NSView,
        );

        #[cfg(all(feature = "NSEvent", feature = "NSResponder", feature = "NSView"))]
        #[unsafe(method(mouseExited:withFrame:inView:))]
        #[unsafe(method_family = none)]
        pub unsafe fn mouseExited_withFrame_inView(
            &self,
            event: &NSEvent,
            frame: NSRect,
            view: &NSView,
        );

        #[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 = "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(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>,
        );
    );
}

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

        #[unsafe(method(initTextCell:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;

        #[cfg(feature = "NSImage")]
        #[unsafe(method(initImageCell:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initImageCell(
            this: Allocated<Self>,
            image: Option<&NSImage>,
        ) -> Retained<Self>;

        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
impl NSPathCell {
    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/nspathcelldelegate?language=objc)
    pub unsafe trait NSPathCellDelegate: NSObjectProtocol + MainThreadOnly {
        #[cfg(all(
            feature = "NSActionCell",
            feature = "NSCell",
            feature = "NSOpenPanel",
            feature = "NSPanel",
            feature = "NSResponder",
            feature = "NSSavePanel",
            feature = "NSWindow"
        ))]
        #[optional]
        #[unsafe(method(pathCell:willDisplayOpenPanel:))]
        #[unsafe(method_family = none)]
        unsafe fn pathCell_willDisplayOpenPanel(
            &self,
            path_cell: &NSPathCell,
            open_panel: &NSOpenPanel,
        );

        #[cfg(all(feature = "NSActionCell", feature = "NSCell", feature = "NSMenu"))]
        #[optional]
        #[unsafe(method(pathCell:willPopUpMenu:))]
        #[unsafe(method_family = none)]
        unsafe fn pathCell_willPopUpMenu(&self, path_cell: &NSPathCell, menu: &NSMenu);
    }
);
