objc2_ui_kit/generated/
UIDocumentViewController.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uidocumentviewcontroller?language=objc)
12    #[unsafe(super(UIViewController, UIResponder, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
15    pub struct UIDocumentViewController;
16);
17
18#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
19extern_conformance!(
20    unsafe impl NSCoding for UIDocumentViewController {}
21);
22
23#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
24extern_conformance!(
25    unsafe impl NSObjectProtocol for UIDocumentViewController {}
26);
27
28#[cfg(all(
29    feature = "UIAppearance",
30    feature = "UIResponder",
31    feature = "UIViewController"
32))]
33extern_conformance!(
34    unsafe impl UIAppearanceContainer for UIDocumentViewController {}
35);
36
37#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
38extern_conformance!(
39    unsafe impl UIContentContainer for UIDocumentViewController {}
40);
41
42#[cfg(all(
43    feature = "UIFocus",
44    feature = "UIResponder",
45    feature = "UIViewController"
46))]
47extern_conformance!(
48    unsafe impl UIFocusEnvironment for UIDocumentViewController {}
49);
50
51#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
52extern_conformance!(
53    unsafe impl UIResponderStandardEditActions for UIDocumentViewController {}
54);
55
56#[cfg(all(
57    feature = "UIResponder",
58    feature = "UITraitCollection",
59    feature = "UIViewController"
60))]
61extern_conformance!(
62    unsafe impl UITraitEnvironment for UIDocumentViewController {}
63);
64
65#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
66impl UIDocumentViewController {
67    extern_methods!(
68        #[cfg(feature = "UIDocument")]
69        #[unsafe(method(initWithDocument:))]
70        #[unsafe(method_family = init)]
71        pub unsafe fn initWithDocument(
72            this: Allocated<Self>,
73            document: Option<&UIDocument>,
74        ) -> Retained<Self>;
75
76        #[cfg(feature = "UIDocument")]
77        #[unsafe(method(document))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn document(&self) -> Option<Retained<UIDocument>>;
80
81        #[cfg(feature = "UIDocument")]
82        /// Setter for [`document`][Self::document].
83        #[unsafe(method(setDocument:))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn setDocument(&self, document: Option<&UIDocument>);
86
87        #[cfg(feature = "UIDocumentViewControllerLaunchOptions")]
88        /// Properties to configure the view controller when no document is open.
89        #[unsafe(method(launchOptions))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn launchOptions(&self) -> Retained<UIDocumentViewControllerLaunchOptions>;
92
93        #[cfg(feature = "UIDocumentViewControllerLaunchOptions")]
94        /// Setter for [`launchOptions`][Self::launchOptions].
95        #[unsafe(method(setLaunchOptions:))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn setLaunchOptions(
98            &self,
99            launch_options: &UIDocumentViewControllerLaunchOptions,
100        );
101
102        /// When this view controller updates its navigation item, this method will be called, allowing subclasses to apply any kind of customization you might want.
103        #[unsafe(method(navigationItemDidUpdate))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn navigationItemDidUpdate(&self);
106
107        #[cfg(feature = "block2")]
108        /// Opens the current document.
109        /// This method is optional. If the document is not opened by the time the view controller becomes visible, the view controller will take care of opening the document.
110        /// If the document is already opened, the completion handler will be called as if opening the document succeeded.
111        #[unsafe(method(openDocumentWithCompletionHandler:))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn openDocumentWithCompletionHandler(
114            &self,
115            completion_handler: &block2::DynBlock<dyn Fn(Bool)>,
116        );
117
118        /// Notifies subclasses that the specified document was opened. This method will be called by the system after
119        /// opening the document initially or after the presented document was changed.
120        #[unsafe(method(documentDidOpen))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn documentDidOpen(&self);
123
124        #[cfg(feature = "UIBarButtonItemGroup")]
125        /// MARK: Custom Navigation Items
126        #[unsafe(method(undoRedoItemGroup))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn undoRedoItemGroup(&self) -> Retained<UIBarButtonItemGroup>;
129    );
130}
131
132/// Methods declared on superclass `UIViewController`.
133#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
134impl UIDocumentViewController {
135    extern_methods!(
136        #[unsafe(method(initWithNibName:bundle:))]
137        #[unsafe(method_family = init)]
138        pub unsafe fn initWithNibName_bundle(
139            this: Allocated<Self>,
140            nib_name_or_nil: Option<&NSString>,
141            nib_bundle_or_nil: Option<&NSBundle>,
142        ) -> Retained<Self>;
143
144        #[unsafe(method(initWithCoder:))]
145        #[unsafe(method_family = init)]
146        pub unsafe fn initWithCoder(
147            this: Allocated<Self>,
148            coder: &NSCoder,
149        ) -> Option<Retained<Self>>;
150    );
151}
152
153/// Methods declared on superclass `NSObject`.
154#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
155impl UIDocumentViewController {
156    extern_methods!(
157        #[unsafe(method(init))]
158        #[unsafe(method_family = init)]
159        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
160
161        #[unsafe(method(new))]
162        #[unsafe(method_family = new)]
163        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
164    );
165}