objc2_ui_kit/generated/
UIDocumentBrowserViewController.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-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-uniform-type-identifiers")]
10use objc2_uniform_type_identifiers::*;
11
12use crate::*;
13
14extern "C" {
15    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uidocumentbrowsererrordomain?language=objc)
16    pub static UIDocumentBrowserErrorDomain: &'static NSErrorDomain;
17}
18
19/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uidocumentbrowsererrorcode?language=objc)
20// NS_ERROR_ENUM
21#[repr(transparent)]
22#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
23pub struct UIDocumentBrowserErrorCode(pub NSInteger);
24impl UIDocumentBrowserErrorCode {
25    #[doc(alias = "UIDocumentBrowserErrorGeneric")]
26    pub const Generic: Self = Self(1);
27    #[doc(alias = "UIDocumentBrowserErrorNoLocationAvailable")]
28    pub const NoLocationAvailable: Self = Self(2);
29}
30
31unsafe impl Encode for UIDocumentBrowserErrorCode {
32    const ENCODING: Encoding = NSInteger::ENCODING;
33}
34
35unsafe impl RefEncode for UIDocumentBrowserErrorCode {
36    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
37}
38
39/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uidocumentbrowserimportmode?language=objc)
40// NS_ENUM
41#[repr(transparent)]
42#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
43pub struct UIDocumentBrowserImportMode(pub NSUInteger);
44impl UIDocumentBrowserImportMode {
45    #[doc(alias = "UIDocumentBrowserImportModeNone")]
46    pub const None: Self = Self(0);
47    #[doc(alias = "UIDocumentBrowserImportModeCopy")]
48    pub const Copy: Self = Self(1);
49    #[doc(alias = "UIDocumentBrowserImportModeMove")]
50    pub const Move: Self = Self(2);
51}
52
53unsafe impl Encode for UIDocumentBrowserImportMode {
54    const ENCODING: Encoding = NSUInteger::ENCODING;
55}
56
57unsafe impl RefEncode for UIDocumentBrowserImportMode {
58    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
59}
60
61/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uidocumentbrowseruserinterfacestyle?language=objc)
62// NS_ENUM
63#[repr(transparent)]
64#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
65pub struct UIDocumentBrowserUserInterfaceStyle(pub NSUInteger);
66impl UIDocumentBrowserUserInterfaceStyle {
67    #[doc(alias = "UIDocumentBrowserUserInterfaceStyleWhite")]
68    pub const White: Self = Self(0);
69    #[doc(alias = "UIDocumentBrowserUserInterfaceStyleLight")]
70    pub const Light: Self = Self(1);
71    #[doc(alias = "UIDocumentBrowserUserInterfaceStyleDark")]
72    pub const Dark: Self = Self(2);
73}
74
75unsafe impl Encode for UIDocumentBrowserUserInterfaceStyle {
76    const ENCODING: Encoding = NSUInteger::ENCODING;
77}
78
79unsafe impl RefEncode for UIDocumentBrowserUserInterfaceStyle {
80    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
81}
82
83extern_class!(
84    /// UIDocumentBrowserViewController is a view controller to browse the files on the user's device or cloud services and open them directly in your application
85    ///
86    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uidocumentbrowserviewcontroller?language=objc)
87    #[unsafe(super(UIViewController, UIResponder, NSObject))]
88    #[derive(Debug, PartialEq, Eq, Hash)]
89    #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
90    pub struct UIDocumentBrowserViewController;
91);
92
93#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
94unsafe impl NSCoding for UIDocumentBrowserViewController {}
95
96#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
97unsafe impl NSObjectProtocol for UIDocumentBrowserViewController {}
98
99#[cfg(all(
100    feature = "UIAppearance",
101    feature = "UIResponder",
102    feature = "UIViewController"
103))]
104unsafe impl UIAppearanceContainer for UIDocumentBrowserViewController {}
105
106#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
107unsafe impl UIContentContainer for UIDocumentBrowserViewController {}
108
109#[cfg(all(
110    feature = "UIFocus",
111    feature = "UIResponder",
112    feature = "UIViewController"
113))]
114unsafe impl UIFocusEnvironment for UIDocumentBrowserViewController {}
115
116#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
117unsafe impl UIResponderStandardEditActions for UIDocumentBrowserViewController {}
118
119#[cfg(all(
120    feature = "UIResponder",
121    feature = "UITraitCollection",
122    feature = "UIViewController"
123))]
124unsafe impl UITraitEnvironment for UIDocumentBrowserViewController {}
125
126#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
127impl UIDocumentBrowserViewController {
128    extern_methods!(
129        /// Parameter `allowedContentTypes`: The document types that the user should be able to open. If nil, the types specified via the CFBundleDocumentTypes key in the application plist will be used instead.
130        #[deprecated]
131        #[unsafe(method(initForOpeningFilesWithContentTypes:))]
132        #[unsafe(method_family = init)]
133        pub unsafe fn initForOpeningFilesWithContentTypes(
134            this: Allocated<Self>,
135            allowed_content_types: Option<&NSArray<NSString>>,
136        ) -> Retained<Self>;
137
138        #[cfg(feature = "objc2-uniform-type-identifiers")]
139        /// Parameter `contentTypes`: The content types that the user should be able to open. If nil, the types specified via the CFBundleDocumentTypes key in the application plist will be used instead.
140        #[unsafe(method(initForOpeningContentTypes:))]
141        #[unsafe(method_family = init)]
142        pub unsafe fn initForOpeningContentTypes(
143            this: Allocated<Self>,
144            content_types: Option<&NSArray<UTType>>,
145        ) -> Retained<Self>;
146
147        /// Please use the designated initializers above instead.
148        #[unsafe(method(initWithNibName:bundle:))]
149        #[unsafe(method_family = init)]
150        pub unsafe fn initWithNibName_bundle(
151            this: Allocated<Self>,
152            nib_name: Option<&NSString>,
153            bundle: Option<&NSBundle>,
154        ) -> Retained<Self>;
155
156        #[unsafe(method(delegate))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn delegate(
159            &self,
160        ) -> Option<Retained<ProtocolObject<dyn UIDocumentBrowserViewControllerDelegate>>>;
161
162        /// This is a [weak property][objc2::topics::weak_property].
163        /// Setter for [`delegate`][Self::delegate].
164        #[unsafe(method(setDelegate:))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn setDelegate(
167            &self,
168            delegate: Option<&ProtocolObject<dyn UIDocumentBrowserViewControllerDelegate>>,
169        );
170
171        /// Defaults to YES
172        #[unsafe(method(allowsDocumentCreation))]
173        #[unsafe(method_family = none)]
174        pub unsafe fn allowsDocumentCreation(&self) -> bool;
175
176        /// Setter for [`allowsDocumentCreation`][Self::allowsDocumentCreation].
177        #[unsafe(method(setAllowsDocumentCreation:))]
178        #[unsafe(method_family = none)]
179        pub unsafe fn setAllowsDocumentCreation(&self, allows_document_creation: bool);
180
181        #[cfg(feature = "UIDocument")]
182        /// The active document creation intent.
183        #[unsafe(method(activeDocumentCreationIntent))]
184        #[unsafe(method_family = none)]
185        pub unsafe fn activeDocumentCreationIntent(
186            &self,
187        ) -> Option<Retained<UIDocumentCreationIntent>>;
188
189        /// Defaults to NO
190        #[unsafe(method(allowsPickingMultipleItems))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn allowsPickingMultipleItems(&self) -> bool;
193
194        /// Setter for [`allowsPickingMultipleItems`][Self::allowsPickingMultipleItems].
195        #[unsafe(method(setAllowsPickingMultipleItems:))]
196        #[unsafe(method_family = none)]
197        pub unsafe fn setAllowsPickingMultipleItems(&self, allows_picking_multiple_items: bool);
198
199        #[deprecated = "allowedContentTypes is no longer supported"]
200        #[unsafe(method(allowedContentTypes))]
201        #[unsafe(method_family = none)]
202        pub unsafe fn allowedContentTypes(&self) -> Retained<NSArray<NSString>>;
203
204        /// Array of content types supported for Recents documents.
205        /// Default is same as allowedContentTypes.
206        /// Can be defined via the 'UIDocumentBrowserRecentDocumentContentTypes' key in the app Info.plist.
207        /// Note that the recentDocumentsContentTypes must be a subset conforming to the types declared in allowedContentTypes.
208        #[deprecated]
209        #[unsafe(method(recentDocumentsContentTypes))]
210        #[unsafe(method_family = none)]
211        pub unsafe fn recentDocumentsContentTypes(&self) -> Retained<NSArray<NSString>>;
212
213        #[cfg(feature = "objc2-uniform-type-identifiers")]
214        /// Array of content types supported for Recents documents.
215        /// Default is same as content types passed in the designated initializer or as CFBundleDocumentTypes  in the app Info.plist.
216        /// Can be defined via the 'UIDocumentBrowserRecentDocumentContentTypes' key in the app Info.plist.
217        /// Note that the contentTypesForRecentDocuments must be a subset conforming to the types passed in the initializer or Info.plist.
218        #[unsafe(method(contentTypesForRecentDocuments))]
219        #[unsafe(method_family = none)]
220        pub unsafe fn contentTypesForRecentDocuments(&self) -> Retained<NSArray<UTType>>;
221
222        /// Force the display of file extensions (default: NO).
223        #[unsafe(method(shouldShowFileExtensions))]
224        #[unsafe(method_family = none)]
225        pub unsafe fn shouldShowFileExtensions(&self) -> bool;
226
227        /// Setter for [`shouldShowFileExtensions`][Self::shouldShowFileExtensions].
228        #[unsafe(method(setShouldShowFileExtensions:))]
229        #[unsafe(method_family = none)]
230        pub unsafe fn setShouldShowFileExtensions(&self, should_show_file_extensions: bool);
231
232        #[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
233        /// An array of buttons that will be added to the existing buttons in the UIDocumentBrowserViewController navigation bar
234        #[unsafe(method(additionalLeadingNavigationBarButtonItems))]
235        #[unsafe(method_family = none)]
236        pub unsafe fn additionalLeadingNavigationBarButtonItems(
237            &self,
238        ) -> Retained<NSArray<UIBarButtonItem>>;
239
240        #[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
241        /// Setter for [`additionalLeadingNavigationBarButtonItems`][Self::additionalLeadingNavigationBarButtonItems].
242        #[unsafe(method(setAdditionalLeadingNavigationBarButtonItems:))]
243        #[unsafe(method_family = none)]
244        pub unsafe fn setAdditionalLeadingNavigationBarButtonItems(
245            &self,
246            additional_leading_navigation_bar_button_items: &NSArray<UIBarButtonItem>,
247        );
248
249        #[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
250        /// An array of buttons that will be added to the existing buttons in the UIDocumentBrowserViewController navigation bar
251        #[unsafe(method(additionalTrailingNavigationBarButtonItems))]
252        #[unsafe(method_family = none)]
253        pub unsafe fn additionalTrailingNavigationBarButtonItems(
254            &self,
255        ) -> Retained<NSArray<UIBarButtonItem>>;
256
257        #[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
258        /// Setter for [`additionalTrailingNavigationBarButtonItems`][Self::additionalTrailingNavigationBarButtonItems].
259        #[unsafe(method(setAdditionalTrailingNavigationBarButtonItems:))]
260        #[unsafe(method_family = none)]
261        pub unsafe fn setAdditionalTrailingNavigationBarButtonItems(
262            &self,
263            additional_trailing_navigation_bar_button_items: &NSArray<UIBarButtonItem>,
264        );
265
266        #[cfg(feature = "block2")]
267        /// Called to reveal a document at the URL.
268        /// Typically called from the application delegate method application:openURL:options:; to let the application present the document.
269        #[unsafe(method(revealDocumentAtURL:importIfNeeded:completion:))]
270        #[unsafe(method_family = none)]
271        pub unsafe fn revealDocumentAtURL_importIfNeeded_completion(
272            &self,
273            url: &NSURL,
274            import_if_needed: bool,
275            completion: Option<&block2::Block<dyn Fn(*mut NSURL, *mut NSError)>>,
276        );
277
278        #[cfg(feature = "block2")]
279        /// Allow a document to be imported next to another document.
280        #[unsafe(method(importDocumentAtURL:nextToDocumentAtURL:mode:completionHandler:))]
281        #[unsafe(method_family = none)]
282        pub unsafe fn importDocumentAtURL_nextToDocumentAtURL_mode_completionHandler(
283            &self,
284            document_url: &NSURL,
285            neighbour_url: &NSURL,
286            import_mode: UIDocumentBrowserImportMode,
287            completion: &block2::Block<dyn Fn(*mut NSURL, *mut NSError)>,
288        );
289
290        #[cfg(feature = "block2")]
291        /// Rename a document.
292        /// If the proposed name is already taken, a different name may be used after confirming with the user.
293        /// The finalURL and error are available in the completion handler.
294        #[unsafe(method(renameDocumentAtURL:proposedName:completionHandler:))]
295        #[unsafe(method_family = none)]
296        pub unsafe fn renameDocumentAtURL_proposedName_completionHandler(
297            &self,
298            document_url: &NSURL,
299            proposed_name: &NSString,
300            completion_handler: &block2::Block<dyn Fn(*mut NSURL, *mut NSError)>,
301        );
302
303        /// A UIDocumentBrowserTransitionController object is used to display a loading indicator, while the application is spending time on time-consuming operations (e.g., loading, parsing, …) after having finished the file download, and before presenting it. To be used together with the UIViewControllerTransitioningDelegate protocol for custom view controller transitions.
304        #[unsafe(method(transitionControllerForDocumentAtURL:))]
305        #[unsafe(method_family = none)]
306        pub unsafe fn transitionControllerForDocumentAtURL(
307            &self,
308            document_url: &NSURL,
309        ) -> Retained<UIDocumentBrowserTransitionController>;
310
311        #[deprecated]
312        #[unsafe(method(transitionControllerForDocumentURL:))]
313        #[unsafe(method_family = none)]
314        pub unsafe fn transitionControllerForDocumentURL(
315            &self,
316            document_url: &NSURL,
317        ) -> Retained<UIDocumentBrowserTransitionController>;
318
319        #[cfg(feature = "UIDocumentBrowserAction")]
320        /// Allows clients to add custom actions in the menu and the navigation bar. These actions are contextual to the document items.
321        #[unsafe(method(customActions))]
322        #[unsafe(method_family = none)]
323        pub unsafe fn customActions(&self) -> Retained<NSArray<UIDocumentBrowserAction>>;
324
325        #[cfg(feature = "UIDocumentBrowserAction")]
326        /// Setter for [`customActions`][Self::customActions].
327        #[unsafe(method(setCustomActions:))]
328        #[unsafe(method_family = none)]
329        pub unsafe fn setCustomActions(&self, custom_actions: &NSArray<UIDocumentBrowserAction>);
330
331        /// Allows clients to customize the look of the browser. Default: UIDocumentBrowserUserInterfaceStyleWhite
332        #[unsafe(method(browserUserInterfaceStyle))]
333        #[unsafe(method_family = none)]
334        pub unsafe fn browserUserInterfaceStyle(&self) -> UIDocumentBrowserUserInterfaceStyle;
335
336        /// Setter for [`browserUserInterfaceStyle`][Self::browserUserInterfaceStyle].
337        #[unsafe(method(setBrowserUserInterfaceStyle:))]
338        #[unsafe(method_family = none)]
339        pub unsafe fn setBrowserUserInterfaceStyle(
340            &self,
341            browser_user_interface_style: UIDocumentBrowserUserInterfaceStyle,
342        );
343
344        /// Title of the Create Document button (default: "Create Document”).
345        #[unsafe(method(localizedCreateDocumentActionTitle))]
346        #[unsafe(method_family = none)]
347        pub unsafe fn localizedCreateDocumentActionTitle(&self) -> Retained<NSString>;
348
349        /// Setter for [`localizedCreateDocumentActionTitle`][Self::localizedCreateDocumentActionTitle].
350        #[unsafe(method(setLocalizedCreateDocumentActionTitle:))]
351        #[unsafe(method_family = none)]
352        pub unsafe fn setLocalizedCreateDocumentActionTitle(
353            &self,
354            localized_create_document_action_title: &NSString,
355        );
356
357        #[cfg(feature = "objc2-core-foundation")]
358        /// Aspect ratio of the Create Document button defined as width / height (default: 2/3).
359        #[unsafe(method(defaultDocumentAspectRatio))]
360        #[unsafe(method_family = none)]
361        pub unsafe fn defaultDocumentAspectRatio(&self) -> CGFloat;
362
363        #[cfg(feature = "objc2-core-foundation")]
364        /// Setter for [`defaultDocumentAspectRatio`][Self::defaultDocumentAspectRatio].
365        #[unsafe(method(setDefaultDocumentAspectRatio:))]
366        #[unsafe(method_family = none)]
367        pub unsafe fn setDefaultDocumentAspectRatio(&self, default_document_aspect_ratio: CGFloat);
368    );
369}
370
371/// Methods declared on superclass `UIViewController`.
372#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
373impl UIDocumentBrowserViewController {
374    extern_methods!(
375        #[unsafe(method(initWithCoder:))]
376        #[unsafe(method_family = init)]
377        pub unsafe fn initWithCoder(
378            this: Allocated<Self>,
379            coder: &NSCoder,
380        ) -> Option<Retained<Self>>;
381    );
382}
383
384/// Methods declared on superclass `NSObject`.
385#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
386impl UIDocumentBrowserViewController {
387    extern_methods!(
388        #[unsafe(method(init))]
389        #[unsafe(method_family = init)]
390        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
391
392        #[unsafe(method(new))]
393        #[unsafe(method_family = new)]
394        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
395    );
396}
397
398extern_protocol!(
399    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uidocumentbrowserviewcontrollerdelegate?language=objc)
400    pub unsafe trait UIDocumentBrowserViewControllerDelegate: NSObjectProtocol {
401        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
402        /// Called when the user validates a selection of items to open or pick.
403        /// If you have created this document manager to open files, you should then open the document, potentially using a
404        /// `UIDocumentBrowserTransitionController`for the transition.
405        #[deprecated]
406        #[optional]
407        #[unsafe(method(documentBrowser:didPickDocumentURLs:))]
408        #[unsafe(method_family = none)]
409        unsafe fn documentBrowser_didPickDocumentURLs(
410            &self,
411            controller: &UIDocumentBrowserViewController,
412            document_ur_ls: &NSArray<NSURL>,
413        );
414
415        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
416        #[optional]
417        #[unsafe(method(documentBrowser:didPickDocumentsAtURLs:))]
418        #[unsafe(method_family = none)]
419        unsafe fn documentBrowser_didPickDocumentsAtURLs(
420            &self,
421            controller: &UIDocumentBrowserViewController,
422            document_ur_ls: &NSArray<NSURL>,
423        );
424
425        #[cfg(all(
426            feature = "UIResponder",
427            feature = "UIViewController",
428            feature = "block2"
429        ))]
430        /// When the user requests the creation of a new document, this method will be called. The application can then, optionally, present UI
431        /// it deems appropriate to let the user configure the new document (for example, it could show a list of templates).
432        /// When done, create an empty document or a copy of your template to a temporary location.
433        /// Then use the importHandler to pass the document URL to be imported.
434        /// If the user cancels the document creation, it's still expetected to call importHandler(nil, UIDocumentBrowserImportModeNone).
435        /// The Document Browser will asynchronously move the document to its final destination and call back one of the following delegate methods:
436        /// -documentBrowser:didImportDocumentURL:toDestinationURL:
437        /// -documentBrowser:failedToImportDocumentAtURL:error:
438        /// The app should wait for the delegate callbacks before presenting the imported document at the destination URL. Usage of UIDocument is recommended.
439        /// If you do not implement this method, document creation will not be available.
440        #[optional]
441        #[unsafe(method(documentBrowser:didRequestDocumentCreationWithHandler:))]
442        #[unsafe(method_family = none)]
443        unsafe fn documentBrowser_didRequestDocumentCreationWithHandler(
444            &self,
445            controller: &UIDocumentBrowserViewController,
446            import_handler: &block2::Block<dyn Fn(*mut NSURL, UIDocumentBrowserImportMode)>,
447        );
448
449        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
450        #[optional]
451        #[unsafe(method(documentBrowser:didImportDocumentAtURL:toDestinationURL:))]
452        #[unsafe(method_family = none)]
453        unsafe fn documentBrowser_didImportDocumentAtURL_toDestinationURL(
454            &self,
455            controller: &UIDocumentBrowserViewController,
456            source_url: &NSURL,
457            destination_url: &NSURL,
458        );
459
460        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
461        #[optional]
462        #[unsafe(method(documentBrowser:failedToImportDocumentAtURL:error:))]
463        #[unsafe(method_family = none)]
464        unsafe fn documentBrowser_failedToImportDocumentAtURL_error(
465            &self,
466            controller: &UIDocumentBrowserViewController,
467            document_url: &NSURL,
468            error: Option<&NSError>,
469        );
470
471        #[cfg(all(
472            feature = "UIActivity",
473            feature = "UIResponder",
474            feature = "UIViewController"
475        ))]
476        /// Allows clients to add application specific UIActivity instances
477        #[optional]
478        #[unsafe(method(documentBrowser:applicationActivitiesForDocumentURLs:))]
479        #[unsafe(method_family = none)]
480        unsafe fn documentBrowser_applicationActivitiesForDocumentURLs(
481            &self,
482            controller: &UIDocumentBrowserViewController,
483            document_ur_ls: &NSArray<NSURL>,
484        ) -> Retained<NSArray<UIActivity>>;
485
486        #[cfg(all(
487            feature = "UIActivityViewController",
488            feature = "UIResponder",
489            feature = "UIViewController"
490        ))]
491        /// Implement this to customize the UIActivityViewController before it's presented.
492        #[optional]
493        #[unsafe(method(documentBrowser:willPresentActivityViewController:))]
494        #[unsafe(method_family = none)]
495        unsafe fn documentBrowser_willPresentActivityViewController(
496            &self,
497            controller: &UIDocumentBrowserViewController,
498            activity_view_controller: &UIActivityViewController,
499        );
500    }
501);
502
503extern_class!(
504    /// Class to handle the loading and animation transition when opening or closing a document.
505    ///
506    /// You can use this object to display a loading indicator if you need time to perform time-consuming operations (loading, parsing, …) after the document download and before presenting it. You can also get a transition controller to pass to UIKit when pushing or presenting your document view
507    /// in response to
508    /// `documentBrowser:didPickItem:,`or when popping or dismissing it.
509    ///
510    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uidocumentbrowsertransitioncontroller?language=objc)
511    #[unsafe(super(NSObject))]
512    #[thread_kind = MainThreadOnly]
513    #[derive(Debug, PartialEq, Eq, Hash)]
514    pub struct UIDocumentBrowserTransitionController;
515);
516
517unsafe impl NSObjectProtocol for UIDocumentBrowserTransitionController {}
518
519#[cfg(feature = "UIViewControllerTransitioning")]
520unsafe impl UIViewControllerAnimatedTransitioning for UIDocumentBrowserTransitionController {}
521
522impl UIDocumentBrowserTransitionController {
523    extern_methods!(
524        #[unsafe(method(init))]
525        #[unsafe(method_family = init)]
526        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
527
528        /// An optional progress can be displayed on the document thumbnail while the document is loading (during opening).
529        #[unsafe(method(loadingProgress))]
530        #[unsafe(method_family = none)]
531        pub unsafe fn loadingProgress(&self) -> Option<Retained<NSProgress>>;
532
533        /// Setter for [`loadingProgress`][Self::loadingProgress].
534        #[unsafe(method(setLoadingProgress:))]
535        #[unsafe(method_family = none)]
536        pub unsafe fn setLoadingProgress(&self, loading_progress: Option<&NSProgress>);
537
538        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
539        /// This view will be used for the zoom transition from/to the document collection view.
540        /// If UIDocumentBrowserViewController is being dismissed, this view should be a subview of the presented view controller's view
541        /// If UIDocumentBrowserViewController is being presented, this view should be a subview of the presenting view controller's view
542        #[unsafe(method(targetView))]
543        #[unsafe(method_family = none)]
544        pub unsafe fn targetView(&self) -> Option<Retained<UIView>>;
545
546        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
547        /// This is a [weak property][objc2::topics::weak_property].
548        /// Setter for [`targetView`][Self::targetView].
549        #[unsafe(method(setTargetView:))]
550        #[unsafe(method_family = none)]
551        pub unsafe fn setTargetView(&self, target_view: Option<&UIView>);
552    );
553}
554
555/// Methods declared on superclass `NSObject`.
556impl UIDocumentBrowserTransitionController {
557    extern_methods!(
558        #[unsafe(method(new))]
559        #[unsafe(method_family = new)]
560        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
561    );
562}