use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSToolbarItem, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "NSToolbarItem")]
pub struct NSSharingServicePickerToolbarItem;
);
#[cfg(feature = "NSToolbarItem")]
extern_conformance!(
unsafe impl NSCopying for NSSharingServicePickerToolbarItem {}
);
#[cfg(feature = "NSToolbarItem")]
unsafe impl CopyingHelper for NSSharingServicePickerToolbarItem {
type Result = Self;
}
#[cfg(feature = "NSToolbarItem")]
extern_conformance!(
unsafe impl NSObjectProtocol for NSSharingServicePickerToolbarItem {}
);
#[cfg(feature = "NSToolbarItem")]
impl NSSharingServicePickerToolbarItem {
extern_methods!(
#[cfg(feature = "NSSharingService")]
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn NSSharingServicePickerToolbarItemDelegate>>>;
#[cfg(feature = "NSSharingService")]
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn NSSharingServicePickerToolbarItemDelegate>>,
);
);
}
#[cfg(feature = "NSToolbarItem")]
impl NSSharingServicePickerToolbarItem {
extern_methods!(
#[cfg(feature = "NSToolbar")]
#[unsafe(method(initWithItemIdentifier:))]
#[unsafe(method_family = init)]
pub fn initWithItemIdentifier(
this: Allocated<Self>,
item_identifier: &NSToolbarItemIdentifier,
) -> Retained<Self>;
);
}
#[cfg(feature = "NSToolbarItem")]
impl NSSharingServicePickerToolbarItem {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_protocol!(
#[cfg(feature = "NSSharingService")]
pub unsafe trait NSSharingServicePickerToolbarItemDelegate:
NSSharingServicePickerDelegate + MainThreadOnly
{
#[cfg(feature = "NSToolbarItem")]
#[unsafe(method(itemsForSharingServicePickerToolbarItem:))]
#[unsafe(method_family = none)]
fn itemsForSharingServicePickerToolbarItem(
&self,
picker_toolbar_item: &NSSharingServicePickerToolbarItem,
) -> Retained<NSArray>;
}
);