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