objc2_ui_kit/generated/
UIDocumentInteractionController.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 #[unsafe(super(NSObject))]
15 #[thread_kind = MainThreadOnly]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 pub struct UIDocumentInteractionController;
18);
19
20extern_conformance!(
21 unsafe impl NSObjectProtocol for UIDocumentInteractionController {}
22);
23
24#[cfg(feature = "UIActionSheet")]
25extern_conformance!(
26 unsafe impl UIActionSheetDelegate for UIDocumentInteractionController {}
27);
28
29impl UIDocumentInteractionController {
30 extern_methods!(
31 #[unsafe(method(interactionControllerWithURL:))]
32 #[unsafe(method_family = none)]
33 pub unsafe fn interactionControllerWithURL(
34 url: &NSURL,
35 mtm: MainThreadMarker,
36 ) -> Retained<UIDocumentInteractionController>;
37
38 #[unsafe(method(delegate))]
39 #[unsafe(method_family = none)]
40 pub unsafe fn delegate(
41 &self,
42 ) -> Option<Retained<ProtocolObject<dyn UIDocumentInteractionControllerDelegate>>>;
43
44 #[unsafe(method(setDelegate:))]
47 #[unsafe(method_family = none)]
48 pub unsafe fn setDelegate(
49 &self,
50 delegate: Option<&ProtocolObject<dyn UIDocumentInteractionControllerDelegate>>,
51 );
52
53 #[unsafe(method(URL))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn URL(&self) -> Option<Retained<NSURL>>;
56
57 #[unsafe(method(setURL:))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn setURL(&self, url: Option<&NSURL>);
61
62 #[unsafe(method(UTI))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn UTI(&self) -> Option<Retained<NSString>>;
65
66 #[unsafe(method(setUTI:))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn setUTI(&self, uti: Option<&NSString>);
70
71 #[unsafe(method(name))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn name(&self) -> Option<Retained<NSString>>;
74
75 #[unsafe(method(setName:))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn setName(&self, name: Option<&NSString>);
79
80 #[cfg(feature = "UIImage")]
81 #[unsafe(method(icons))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn icons(&self) -> Retained<NSArray<UIImage>>;
84
85 #[unsafe(method(annotation))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn annotation(&self) -> Option<Retained<AnyObject>>;
88
89 #[unsafe(method(setAnnotation:))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn setAnnotation(&self, annotation: Option<&AnyObject>);
93
94 #[cfg(all(
95 feature = "UIResponder",
96 feature = "UIView",
97 feature = "objc2-core-foundation"
98 ))]
99 #[unsafe(method(presentOptionsMenuFromRect:inView:animated:))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn presentOptionsMenuFromRect_inView_animated(
102 &self,
103 rect: CGRect,
104 view: &UIView,
105 animated: bool,
106 ) -> bool;
107
108 #[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
109 #[unsafe(method(presentOptionsMenuFromBarButtonItem:animated:))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn presentOptionsMenuFromBarButtonItem_animated(
112 &self,
113 item: &UIBarButtonItem,
114 animated: bool,
115 ) -> bool;
116
117 #[unsafe(method(presentPreviewAnimated:))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn presentPreviewAnimated(&self, animated: bool) -> bool;
120
121 #[cfg(all(
122 feature = "UIResponder",
123 feature = "UIView",
124 feature = "objc2-core-foundation"
125 ))]
126 #[unsafe(method(presentOpenInMenuFromRect:inView:animated:))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn presentOpenInMenuFromRect_inView_animated(
129 &self,
130 rect: CGRect,
131 view: &UIView,
132 animated: bool,
133 ) -> bool;
134
135 #[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
136 #[unsafe(method(presentOpenInMenuFromBarButtonItem:animated:))]
137 #[unsafe(method_family = none)]
138 pub unsafe fn presentOpenInMenuFromBarButtonItem_animated(
139 &self,
140 item: &UIBarButtonItem,
141 animated: bool,
142 ) -> bool;
143
144 #[unsafe(method(dismissPreviewAnimated:))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn dismissPreviewAnimated(&self, animated: bool);
147
148 #[unsafe(method(dismissMenuAnimated:))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn dismissMenuAnimated(&self, animated: bool);
151
152 #[cfg(feature = "UIGestureRecognizer")]
153 #[unsafe(method(gestureRecognizers))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn gestureRecognizers(&self) -> Retained<NSArray<UIGestureRecognizer>>;
156 );
157}
158
159impl UIDocumentInteractionController {
161 extern_methods!(
162 #[unsafe(method(init))]
163 #[unsafe(method_family = init)]
164 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
165
166 #[unsafe(method(new))]
167 #[unsafe(method_family = new)]
168 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
169 );
170}
171
172extern_protocol!(
173 pub unsafe trait UIDocumentInteractionControllerDelegate: NSObjectProtocol {
175 #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
176 #[optional]
177 #[unsafe(method(documentInteractionControllerViewControllerForPreview:))]
178 #[unsafe(method_family = none)]
179 unsafe fn documentInteractionControllerViewControllerForPreview(
180 &self,
181 controller: &UIDocumentInteractionController,
182 ) -> Retained<UIViewController>;
183
184 #[cfg(feature = "objc2-core-foundation")]
185 #[optional]
186 #[unsafe(method(documentInteractionControllerRectForPreview:))]
187 #[unsafe(method_family = none)]
188 unsafe fn documentInteractionControllerRectForPreview(
189 &self,
190 controller: &UIDocumentInteractionController,
191 ) -> CGRect;
192
193 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
194 #[optional]
195 #[unsafe(method(documentInteractionControllerViewForPreview:))]
196 #[unsafe(method_family = none)]
197 unsafe fn documentInteractionControllerViewForPreview(
198 &self,
199 controller: &UIDocumentInteractionController,
200 ) -> Option<Retained<UIView>>;
201
202 #[optional]
203 #[unsafe(method(documentInteractionControllerWillBeginPreview:))]
204 #[unsafe(method_family = none)]
205 unsafe fn documentInteractionControllerWillBeginPreview(
206 &self,
207 controller: &UIDocumentInteractionController,
208 );
209
210 #[optional]
211 #[unsafe(method(documentInteractionControllerDidEndPreview:))]
212 #[unsafe(method_family = none)]
213 unsafe fn documentInteractionControllerDidEndPreview(
214 &self,
215 controller: &UIDocumentInteractionController,
216 );
217
218 #[optional]
219 #[unsafe(method(documentInteractionControllerWillPresentOptionsMenu:))]
220 #[unsafe(method_family = none)]
221 unsafe fn documentInteractionControllerWillPresentOptionsMenu(
222 &self,
223 controller: &UIDocumentInteractionController,
224 );
225
226 #[optional]
227 #[unsafe(method(documentInteractionControllerDidDismissOptionsMenu:))]
228 #[unsafe(method_family = none)]
229 unsafe fn documentInteractionControllerDidDismissOptionsMenu(
230 &self,
231 controller: &UIDocumentInteractionController,
232 );
233
234 #[optional]
235 #[unsafe(method(documentInteractionControllerWillPresentOpenInMenu:))]
236 #[unsafe(method_family = none)]
237 unsafe fn documentInteractionControllerWillPresentOpenInMenu(
238 &self,
239 controller: &UIDocumentInteractionController,
240 );
241
242 #[optional]
243 #[unsafe(method(documentInteractionControllerDidDismissOpenInMenu:))]
244 #[unsafe(method_family = none)]
245 unsafe fn documentInteractionControllerDidDismissOpenInMenu(
246 &self,
247 controller: &UIDocumentInteractionController,
248 );
249
250 #[optional]
251 #[unsafe(method(documentInteractionController:willBeginSendingToApplication:))]
252 #[unsafe(method_family = none)]
253 unsafe fn documentInteractionController_willBeginSendingToApplication(
254 &self,
255 controller: &UIDocumentInteractionController,
256 application: Option<&NSString>,
257 );
258
259 #[optional]
260 #[unsafe(method(documentInteractionController:didEndSendingToApplication:))]
261 #[unsafe(method_family = none)]
262 unsafe fn documentInteractionController_didEndSendingToApplication(
263 &self,
264 controller: &UIDocumentInteractionController,
265 application: Option<&NSString>,
266 );
267
268 #[deprecated]
269 #[optional]
270 #[unsafe(method(documentInteractionController:canPerformAction:))]
271 #[unsafe(method_family = none)]
272 unsafe fn documentInteractionController_canPerformAction(
273 &self,
274 controller: &UIDocumentInteractionController,
275 action: Option<Sel>,
276 ) -> bool;
277
278 #[deprecated]
279 #[optional]
280 #[unsafe(method(documentInteractionController:performAction:))]
281 #[unsafe(method_family = none)]
282 unsafe fn documentInteractionController_performAction(
283 &self,
284 controller: &UIDocumentInteractionController,
285 action: Option<Sel>,
286 ) -> bool;
287 }
288);