use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[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);
}
#[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!(
#[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 fn controlRepresentation(&self) -> NSPickerTouchBarItemControlRepresentation;
#[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>;
#[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")]
#[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;
#[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")]
#[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;
#[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;
#[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>>;
#[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>;
#[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;
#[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;
#[unsafe(method(customizationLabel))]
#[unsafe(method_family = none)]
pub fn customizationLabel(&self) -> Retained<NSString>;
#[unsafe(method(setCustomizationLabel:))]
#[unsafe(method_family = none)]
pub fn setCustomizationLabel(&self, customization_label: Option<&NSString>);
);
}
#[cfg(feature = "NSTouchBarItem")]
impl NSPickerTouchBarItem {
extern_methods!(
#[unsafe(method(initWithIdentifier:))]
#[unsafe(method_family = init)]
pub 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>;
);
}
#[cfg(feature = "NSTouchBarItem")]
impl NSPickerTouchBarItem {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}