//! 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/nspickertouchbaritemselectionmode?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSPickerTouchBarItemSelectionMode(pub NSInteger);
impl NSPickerTouchBarItemSelectionMode {
    #[doc(alias = "NSPickerTouchBarItemSelectionModeSelectOne")]
    pub const SelectOne: Self = Self(0);
    #[doc(alias = "NSPickerTouchBarItemSelectionModeSelectAny")]
    pub const SelectAny: Self = Self(1);
    #[doc(alias = "NSPickerTouchBarItemSelectionModeMomentary")]
    pub const Momentary: Self = Self(2);
}

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

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

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspickertouchbaritemcontrolrepresentation?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSPickerTouchBarItemControlRepresentation(pub NSInteger);
impl NSPickerTouchBarItemControlRepresentation {
    #[doc(alias = "NSPickerTouchBarItemControlRepresentationAutomatic")]
    pub const Automatic: Self = Self(0);
    #[doc(alias = "NSPickerTouchBarItemControlRepresentationExpanded")]
    pub const Expanded: Self = Self(1);
    #[doc(alias = "NSPickerTouchBarItemControlRepresentationCollapsed")]
    pub const Collapsed: Self = Self(2);
}

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

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

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

#[cfg(feature = "NSTouchBarItem")]
extern_conformance!(
    unsafe impl NSCoding for NSPickerTouchBarItem {}
);

#[cfg(feature = "NSTouchBarItem")]
extern_conformance!(
    unsafe impl NSObjectProtocol for NSPickerTouchBarItem {}
);

#[cfg(feature = "NSTouchBarItem")]
impl NSPickerTouchBarItem {
    extern_methods!(
        #[unsafe(method(pickerTouchBarItemWithIdentifier:labels:selectionMode:target:action:))]
        #[unsafe(method_family = none)]
        pub unsafe fn pickerTouchBarItemWithIdentifier_labels_selectionMode_target_action(
            identifier: &NSTouchBarItemIdentifier,
            labels: &NSArray<NSString>,
            selection_mode: NSPickerTouchBarItemSelectionMode,
            target: Option<&AnyObject>,
            action: Option<Sel>,
            mtm: MainThreadMarker,
        ) -> Retained<Self>;

        #[cfg(feature = "NSImage")]
        #[unsafe(method(pickerTouchBarItemWithIdentifier:images:selectionMode:target:action:))]
        #[unsafe(method_family = none)]
        pub unsafe fn pickerTouchBarItemWithIdentifier_images_selectionMode_target_action(
            identifier: &NSTouchBarItemIdentifier,
            images: &NSArray<NSImage>,
            selection_mode: NSPickerTouchBarItemSelectionMode,
            target: Option<&AnyObject>,
            action: Option<Sel>,
            mtm: MainThreadMarker,
        ) -> Retained<Self>;

        #[unsafe(method(controlRepresentation))]
        #[unsafe(method_family = none)]
        pub unsafe fn controlRepresentation(&self) -> NSPickerTouchBarItemControlRepresentation;

        /// Setter for [`controlRepresentation`][Self::controlRepresentation].
        #[unsafe(method(setControlRepresentation:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setControlRepresentation(
            &self,
            control_representation: NSPickerTouchBarItemControlRepresentation,
        );

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

        /// Setter for [`collapsedRepresentationLabel`][Self::collapsedRepresentationLabel].
        #[unsafe(method(setCollapsedRepresentationLabel:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCollapsedRepresentationLabel(
            &self,
            collapsed_representation_label: &NSString,
        );

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

        #[cfg(feature = "NSImage")]
        /// Setter for [`collapsedRepresentationImage`][Self::collapsedRepresentationImage].
        #[unsafe(method(setCollapsedRepresentationImage:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCollapsedRepresentationImage(
            &self,
            collapsed_representation_image: Option<&NSImage>,
        );

        #[unsafe(method(selectedIndex))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectedIndex(&self) -> NSInteger;

        /// Setter for [`selectedIndex`][Self::selectedIndex].
        #[unsafe(method(setSelectedIndex:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSelectedIndex(&self, selected_index: NSInteger);

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

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

        #[unsafe(method(selectionMode))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectionMode(&self) -> NSPickerTouchBarItemSelectionMode;

        /// Setter for [`selectionMode`][Self::selectionMode].
        #[unsafe(method(setSelectionMode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSelectionMode(&self, selection_mode: NSPickerTouchBarItemSelectionMode);

        #[unsafe(method(numberOfOptions))]
        #[unsafe(method_family = none)]
        pub unsafe fn numberOfOptions(&self) -> NSInteger;

        /// Setter for [`numberOfOptions`][Self::numberOfOptions].
        #[unsafe(method(setNumberOfOptions:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setNumberOfOptions(&self, number_of_options: NSInteger);

        #[cfg(feature = "NSImage")]
        #[unsafe(method(setImage:atIndex:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setImage_atIndex(&self, image: Option<&NSImage>, index: NSInteger);

        #[cfg(feature = "NSImage")]
        #[unsafe(method(imageAtIndex:))]
        #[unsafe(method_family = none)]
        pub unsafe fn imageAtIndex(&self, index: NSInteger) -> Option<Retained<NSImage>>;

        #[unsafe(method(setLabel:atIndex:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLabel_atIndex(&self, label: &NSString, index: NSInteger);

        #[unsafe(method(labelAtIndex:))]
        #[unsafe(method_family = none)]
        pub unsafe fn labelAtIndex(&self, index: NSInteger) -> Option<Retained<NSString>>;

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

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

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

        /// Setter for [`action`][Self::action].
        #[unsafe(method(setAction:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAction(&self, action: Option<Sel>);

        #[unsafe(method(isEnabled))]
        #[unsafe(method_family = none)]
        pub unsafe fn isEnabled(&self) -> bool;

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

        #[unsafe(method(setEnabled:atIndex:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setEnabled_atIndex(&self, enabled: bool, index: NSInteger);

        #[unsafe(method(isEnabledAtIndex:))]
        #[unsafe(method_family = none)]
        pub unsafe fn isEnabledAtIndex(&self, index: NSInteger) -> bool;

        /// The localized string labelling this item during user customization. The default value is empty string.
        #[unsafe(method(customizationLabel))]
        #[unsafe(method_family = none)]
        pub unsafe fn customizationLabel(&self) -> Retained<NSString>;

        /// Setter for [`customizationLabel`][Self::customizationLabel].
        #[unsafe(method(setCustomizationLabel:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCustomizationLabel(&self, customization_label: Option<&NSString>);
    );
}

/// Methods declared on superclass `NSTouchBarItem`.
#[cfg(feature = "NSTouchBarItem")]
impl NSPickerTouchBarItem {
    extern_methods!(
        #[unsafe(method(initWithIdentifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithIdentifier(
            this: Allocated<Self>,
            identifier: &NSTouchBarItemIdentifier,
        ) -> Retained<Self>;

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

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

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