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