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