objc2_shared_with_you/generated/
SWCollaborationView.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9use objc2_foundation::*;
10
11use crate::*;
12
13extern_protocol!(
14    /// [Apple's documentation](https://developer.apple.com/documentation/sharedwithyou/swcollaborationviewdelegate?language=objc)
15    pub unsafe trait SWCollaborationViewDelegate: NSObjectProtocol {
16        #[cfg(feature = "objc2-app-kit")]
17        #[cfg(target_os = "macos")]
18        #[optional]
19        #[unsafe(method(collaborationViewShouldPresentPopover:))]
20        #[unsafe(method_family = none)]
21        unsafe fn collaborationViewShouldPresentPopover(
22            &self,
23            collaboration_view: &SWCollaborationView,
24        ) -> bool;
25
26        #[cfg(feature = "objc2-app-kit")]
27        #[cfg(target_os = "macos")]
28        #[optional]
29        #[unsafe(method(collaborationViewWillPresentPopover:))]
30        #[unsafe(method_family = none)]
31        unsafe fn collaborationViewWillPresentPopover(
32            &self,
33            collaboration_view: &SWCollaborationView,
34        );
35
36        #[cfg(feature = "objc2-app-kit")]
37        #[cfg(target_os = "macos")]
38        #[optional]
39        #[unsafe(method(collaborationViewDidDismissPopover:))]
40        #[unsafe(method_family = none)]
41        unsafe fn collaborationViewDidDismissPopover(
42            &self,
43            collaboration_view: &SWCollaborationView,
44        );
45    }
46);
47
48extern_class!(
49    /// [Apple's documentation](https://developer.apple.com/documentation/sharedwithyou/swcollaborationview?language=objc)
50    #[unsafe(super(NSView, NSResponder, NSObject))]
51    #[derive(Debug, PartialEq, Eq, Hash)]
52    #[cfg(feature = "objc2-app-kit")]
53    #[cfg(target_os = "macos")]
54    pub struct SWCollaborationView;
55);
56
57#[cfg(feature = "objc2-app-kit")]
58#[cfg(target_os = "macos")]
59extern_conformance!(
60    unsafe impl NSAccessibility for SWCollaborationView {}
61);
62
63#[cfg(feature = "objc2-app-kit")]
64#[cfg(target_os = "macos")]
65extern_conformance!(
66    unsafe impl NSAccessibilityElementProtocol for SWCollaborationView {}
67);
68
69#[cfg(feature = "objc2-app-kit")]
70#[cfg(target_os = "macos")]
71extern_conformance!(
72    unsafe impl NSAnimatablePropertyContainer for SWCollaborationView {}
73);
74
75#[cfg(feature = "objc2-app-kit")]
76#[cfg(target_os = "macos")]
77extern_conformance!(
78    unsafe impl NSAppearanceCustomization for SWCollaborationView {}
79);
80
81#[cfg(feature = "objc2-app-kit")]
82#[cfg(target_os = "macos")]
83extern_conformance!(
84    unsafe impl NSCoding for SWCollaborationView {}
85);
86
87#[cfg(feature = "objc2-app-kit")]
88#[cfg(target_os = "macos")]
89extern_conformance!(
90    unsafe impl NSDraggingDestination for SWCollaborationView {}
91);
92
93#[cfg(feature = "objc2-app-kit")]
94#[cfg(target_os = "macos")]
95extern_conformance!(
96    unsafe impl NSObjectProtocol for SWCollaborationView {}
97);
98
99#[cfg(feature = "objc2-app-kit")]
100#[cfg(target_os = "macos")]
101extern_conformance!(
102    unsafe impl NSUserInterfaceItemIdentification for SWCollaborationView {}
103);
104
105#[cfg(feature = "objc2-app-kit")]
106#[cfg(target_os = "macos")]
107impl SWCollaborationView {
108    extern_methods!(
109        #[unsafe(method(cloudSharingDelegate))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn cloudSharingDelegate(
112            &self,
113        ) -> Option<Retained<ProtocolObject<dyn NSCloudSharingServiceDelegate>>>;
114
115        /// Setter for [`cloudSharingDelegate`][Self::cloudSharingDelegate].
116        ///
117        /// This is a [weak property][objc2::topics::weak_property].
118        #[unsafe(method(setCloudSharingDelegate:))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn setCloudSharingDelegate(
121            &self,
122            cloud_sharing_delegate: Option<&ProtocolObject<dyn NSCloudSharingServiceDelegate>>,
123        );
124
125        #[unsafe(method(setContentView:))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn setContentView(&self, detail_view_list_content_view: &NSView);
128
129        #[unsafe(method(initWithItemProvider:))]
130        #[unsafe(method_family = init)]
131        pub unsafe fn initWithItemProvider(
132            this: Allocated<Self>,
133            item_provider: &NSItemProvider,
134        ) -> Retained<Self>;
135
136        #[unsafe(method(activeParticipantCount))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn activeParticipantCount(&self) -> NSUInteger;
139
140        /// Setter for [`activeParticipantCount`][Self::activeParticipantCount].
141        #[unsafe(method(setActiveParticipantCount:))]
142        #[unsafe(method_family = none)]
143        pub unsafe fn setActiveParticipantCount(&self, active_participant_count: NSUInteger);
144
145        #[unsafe(method(delegate))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn delegate(
148            &self,
149        ) -> Option<Retained<ProtocolObject<dyn SWCollaborationViewDelegate>>>;
150
151        /// Setter for [`delegate`][Self::delegate].
152        ///
153        /// This is a [weak property][objc2::topics::weak_property].
154        #[unsafe(method(setDelegate:))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn setDelegate(
157            &self,
158            delegate: Option<&ProtocolObject<dyn SWCollaborationViewDelegate>>,
159        );
160
161        #[unsafe(method(headerTitle))]
162        #[unsafe(method_family = none)]
163        pub unsafe fn headerTitle(&self) -> Retained<NSString>;
164
165        /// Setter for [`headerTitle`][Self::headerTitle].
166        ///
167        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
168        #[unsafe(method(setHeaderTitle:))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn setHeaderTitle(&self, header_title: &NSString);
171
172        #[unsafe(method(headerSubtitle))]
173        #[unsafe(method_family = none)]
174        pub unsafe fn headerSubtitle(&self) -> Retained<NSString>;
175
176        /// Setter for [`headerSubtitle`][Self::headerSubtitle].
177        ///
178        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
179        #[unsafe(method(setHeaderSubtitle:))]
180        #[unsafe(method_family = none)]
181        pub unsafe fn setHeaderSubtitle(&self, header_subtitle: &NSString);
182
183        #[unsafe(method(headerImage))]
184        #[unsafe(method_family = none)]
185        pub unsafe fn headerImage(&self) -> Retained<NSImage>;
186
187        /// Setter for [`headerImage`][Self::headerImage].
188        #[unsafe(method(setHeaderImage:))]
189        #[unsafe(method_family = none)]
190        pub unsafe fn setHeaderImage(&self, header_image: &NSImage);
191
192        #[unsafe(method(menuFormRepresentation))]
193        #[unsafe(method_family = none)]
194        pub unsafe fn menuFormRepresentation(&self) -> Retained<NSMenuItem>;
195
196        /// If you are using the built in manage share button, this delegate property will be forwarded along to the NSCloudSharingService that button presents. If you have your own and suppress the provided one via setShowManageButton, this does nothing.
197        #[unsafe(method(cloudSharingServiceDelegate))]
198        #[unsafe(method_family = none)]
199        pub unsafe fn cloudSharingServiceDelegate(
200            &self,
201        ) -> Option<Retained<ProtocolObject<dyn NSCloudSharingServiceDelegate>>>;
202
203        /// Setter for [`cloudSharingServiceDelegate`][Self::cloudSharingServiceDelegate].
204        ///
205        /// This is a [weak property][objc2::topics::weak_property].
206        #[unsafe(method(setCloudSharingServiceDelegate:))]
207        #[unsafe(method_family = none)]
208        pub unsafe fn setCloudSharingServiceDelegate(
209            &self,
210            cloud_sharing_service_delegate: Option<
211                &ProtocolObject<dyn NSCloudSharingServiceDelegate>,
212            >,
213        );
214
215        #[cfg(feature = "block2")]
216        /// Dismisses the popover, if presented.
217        ///
218        /// Parameter `completion`: Called when the popover dismissal finishes.
219        #[unsafe(method(dismissPopover:))]
220        #[unsafe(method_family = none)]
221        pub unsafe fn dismissPopover(&self, completion: Option<&block2::DynBlock<dyn Fn()>>);
222
223        /// sets the title of the manage participants button in the collaboration popover to the given string, defaults to "Manage Share"
224        #[unsafe(method(manageButtonTitle))]
225        #[unsafe(method_family = none)]
226        pub unsafe fn manageButtonTitle(&self) -> Retained<NSString>;
227
228        /// Setter for [`manageButtonTitle`][Self::manageButtonTitle].
229        ///
230        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
231        #[unsafe(method(setManageButtonTitle:))]
232        #[unsafe(method_family = none)]
233        pub unsafe fn setManageButtonTitle(&self, manage_button_title: &NSString);
234
235        /// whether the collaboration popover should show the default manage participants button in the popover, defaults to YES
236        ///
237        /// Parameter `showManageButton`: whether the button should be hidden
238        #[unsafe(method(setShowManageButton:))]
239        #[unsafe(method_family = none)]
240        pub unsafe fn setShowManageButton(&self, show_manage_button: bool);
241    );
242}
243
244/// Methods declared on superclass `NSView`.
245#[cfg(feature = "objc2-app-kit")]
246#[cfg(target_os = "macos")]
247impl SWCollaborationView {
248    extern_methods!(
249        #[unsafe(method(initWithFrame:))]
250        #[unsafe(method_family = init)]
251        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
252
253        /// # Safety
254        ///
255        /// `coder` possibly has further requirements.
256        #[unsafe(method(initWithCoder:))]
257        #[unsafe(method_family = init)]
258        pub unsafe fn initWithCoder(
259            this: Allocated<Self>,
260            coder: &NSCoder,
261        ) -> Option<Retained<Self>>;
262    );
263}
264
265/// Methods declared on superclass `NSResponder`.
266#[cfg(feature = "objc2-app-kit")]
267#[cfg(target_os = "macos")]
268impl SWCollaborationView {
269    extern_methods!(
270        #[unsafe(method(init))]
271        #[unsafe(method_family = init)]
272        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
273    );
274}
275
276/// Methods declared on superclass `NSObject`.
277#[cfg(feature = "objc2-app-kit")]
278#[cfg(target_os = "macos")]
279impl SWCollaborationView {
280    extern_methods!(
281        #[unsafe(method(new))]
282        #[unsafe(method_family = new)]
283        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
284    );
285}