//! 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!(
        /// # Safety
        ///
        /// - `target` should be of the correct type.
        /// - `action` must be a valid selector.
        #[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")]
        /// # Safety
        ///
        /// - `target` should be of the correct type.
        /// - `action` must be a valid selector.
        #[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 fn controlRepresentation(&self) -> NSPickerTouchBarItemControlRepresentation;

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

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

        /// Setter for [`collapsedRepresentationLabel`][Self::collapsedRepresentationLabel].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setCollapsedRepresentationLabel:))]
        #[unsafe(method_family = none)]
        pub fn setCollapsedRepresentationLabel(&self, collapsed_representation_label: &NSString);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        #[unsafe(method(isEnabledAtIndex:))]
        #[unsafe(method_family = none)]
        pub 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 fn customizationLabel(&self) -> Retained<NSString>;

        /// Setter for [`customizationLabel`][Self::customizationLabel].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setCustomizationLabel:))]
        #[unsafe(method_family = none)]
        pub 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 fn initWithIdentifier(
            this: Allocated<Self>,
            identifier: &NSTouchBarItemIdentifier,
        ) -> 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>>;

        #[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>;
    );
}
