use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "NSToolbarItem")]
pub struct NSSharingServicePickerToolbarItem;
#[cfg(feature = "NSToolbarItem")]
unsafe impl ClassType for NSSharingServicePickerToolbarItem {
#[inherits(NSObject)]
type Super = NSToolbarItem;
type Mutability = MainThreadOnly;
}
);
#[cfg(feature = "NSToolbarItem")]
unsafe impl NSCopying for NSSharingServicePickerToolbarItem {}
#[cfg(feature = "NSToolbarItem")]
unsafe impl NSObjectProtocol for NSSharingServicePickerToolbarItem {}
extern_methods!(
#[cfg(feature = "NSToolbarItem")]
unsafe impl NSSharingServicePickerToolbarItem {
#[cfg(feature = "NSSharingService")]
#[method_id(@__retain_semantics Other delegate)]
pub unsafe fn delegate(
&self,
) -> Option<Id<ProtocolObject<dyn NSSharingServicePickerToolbarItemDelegate>>>;
#[cfg(feature = "NSSharingService")]
#[method(setDelegate:)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn NSSharingServicePickerToolbarItemDelegate>>,
);
}
);
extern_methods!(
#[cfg(feature = "NSToolbarItem")]
unsafe impl NSSharingServicePickerToolbarItem {
#[cfg(feature = "NSToolbar")]
#[method_id(@__retain_semantics Init initWithItemIdentifier:)]
pub unsafe fn initWithItemIdentifier(
this: Allocated<Self>,
item_identifier: &NSToolbarItemIdentifier,
) -> Id<Self>;
}
);
extern_methods!(
#[cfg(feature = "NSToolbarItem")]
unsafe impl NSSharingServicePickerToolbarItem {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
}
);
extern_protocol!(
#[cfg(feature = "NSSharingService")]
pub unsafe trait NSSharingServicePickerToolbarItemDelegate:
NSSharingServicePickerDelegate + IsMainThreadOnly
{
#[cfg(feature = "NSToolbarItem")]
#[method_id(@__retain_semantics Other itemsForSharingServicePickerToolbarItem:)]
unsafe fn itemsForSharingServicePickerToolbarItem(
&self,
picker_toolbar_item: &NSSharingServicePickerToolbarItem,
) -> Id<NSArray>;
}
#[cfg(feature = "NSSharingService")]
unsafe impl ProtocolType for dyn NSSharingServicePickerToolbarItemDelegate {}
);