use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSTouchBarItem, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "NSTouchBarItem")]
pub struct NSSharingServicePickerTouchBarItem;
);
#[cfg(feature = "NSTouchBarItem")]
extern_conformance!(
unsafe impl NSCoding for NSSharingServicePickerTouchBarItem {}
);
#[cfg(feature = "NSTouchBarItem")]
extern_conformance!(
unsafe impl NSObjectProtocol for NSSharingServicePickerTouchBarItem {}
);
#[cfg(feature = "NSTouchBarItem")]
impl NSSharingServicePickerTouchBarItem {
extern_methods!(
#[cfg(feature = "NSSharingService")]
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn NSSharingServicePickerTouchBarItemDelegate>>>;
#[cfg(feature = "NSSharingService")]
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn NSSharingServicePickerTouchBarItemDelegate>>,
);
#[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(buttonTitle))]
#[unsafe(method_family = none)]
pub fn buttonTitle(&self) -> Retained<NSString>;
#[unsafe(method(setButtonTitle:))]
#[unsafe(method_family = none)]
pub fn setButtonTitle(&self, button_title: &NSString);
#[cfg(feature = "NSImage")]
#[unsafe(method(buttonImage))]
#[unsafe(method_family = none)]
pub fn buttonImage(&self) -> Option<Retained<NSImage>>;
#[cfg(feature = "NSImage")]
#[unsafe(method(setButtonImage:))]
#[unsafe(method_family = none)]
pub fn setButtonImage(&self, button_image: Option<&NSImage>);
);
}
#[cfg(feature = "NSTouchBarItem")]
impl NSSharingServicePickerTouchBarItem {
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 NSSharingServicePickerTouchBarItem {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_protocol!(
#[cfg(feature = "NSSharingService")]
pub unsafe trait NSSharingServicePickerTouchBarItemDelegate:
NSSharingServicePickerDelegate + MainThreadOnly
{
#[cfg(feature = "NSTouchBarItem")]
#[unsafe(method(itemsForSharingServicePickerTouchBarItem:))]
#[unsafe(method_family = none)]
fn itemsForSharingServicePickerTouchBarItem(
&self,
picker_touch_bar_item: &NSSharingServicePickerTouchBarItem,
) -> Retained<NSArray>;
}
);