objc2_app_kit/generated/
NSSharingServicePickerToolbarItem.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSToolbarItem, NSObject))]
13 #[derive(Debug, PartialEq, Eq, Hash)]
14 #[cfg(feature = "NSToolbarItem")]
15 pub struct NSSharingServicePickerToolbarItem;
16);
17
18#[cfg(feature = "NSToolbarItem")]
19extern_conformance!(
20 unsafe impl NSCopying for NSSharingServicePickerToolbarItem {}
21);
22
23#[cfg(feature = "NSToolbarItem")]
24unsafe impl CopyingHelper for NSSharingServicePickerToolbarItem {
25 type Result = Self;
26}
27
28#[cfg(feature = "NSToolbarItem")]
29extern_conformance!(
30 unsafe impl NSObjectProtocol for NSSharingServicePickerToolbarItem {}
31);
32
33#[cfg(feature = "NSToolbarItem")]
34impl NSSharingServicePickerToolbarItem {
35 extern_methods!(
36 #[cfg(feature = "NSSharingService")]
37 #[unsafe(method(delegate))]
38 #[unsafe(method_family = none)]
39 pub unsafe fn delegate(
40 &self,
41 ) -> Option<Retained<ProtocolObject<dyn NSSharingServicePickerToolbarItemDelegate>>>;
42
43 #[cfg(feature = "NSSharingService")]
44 #[unsafe(method(setDelegate:))]
47 #[unsafe(method_family = none)]
48 pub unsafe fn setDelegate(
49 &self,
50 delegate: Option<&ProtocolObject<dyn NSSharingServicePickerToolbarItemDelegate>>,
51 );
52 );
53}
54
55#[cfg(feature = "NSToolbarItem")]
57impl NSSharingServicePickerToolbarItem {
58 extern_methods!(
59 #[cfg(feature = "NSToolbar")]
60 #[unsafe(method(initWithItemIdentifier:))]
62 #[unsafe(method_family = init)]
63 pub unsafe fn initWithItemIdentifier(
64 this: Allocated<Self>,
65 item_identifier: &NSToolbarItemIdentifier,
66 ) -> Retained<Self>;
67 );
68}
69
70#[cfg(feature = "NSToolbarItem")]
72impl NSSharingServicePickerToolbarItem {
73 extern_methods!(
74 #[unsafe(method(init))]
75 #[unsafe(method_family = init)]
76 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
77
78 #[unsafe(method(new))]
79 #[unsafe(method_family = new)]
80 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
81 );
82}
83
84extern_protocol!(
85 #[cfg(feature = "NSSharingService")]
87 pub unsafe trait NSSharingServicePickerToolbarItemDelegate:
88 NSSharingServicePickerDelegate + MainThreadOnly
89 {
90 #[cfg(feature = "NSToolbarItem")]
91 #[unsafe(method(itemsForSharingServicePickerToolbarItem:))]
96 #[unsafe(method_family = none)]
97 unsafe fn itemsForSharingServicePickerToolbarItem(
98 &self,
99 picker_toolbar_item: &NSSharingServicePickerToolbarItem,
100 ) -> Retained<NSArray>;
101 }
102);