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 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 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 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 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 fn setLaunchOptions(&self, launch_options: &UIDocumentViewControllerLaunchOptions);
98
99        /// When this view controller updates its navigation item, this method will be called, allowing subclasses to apply any kind of customization you might want.
100        #[unsafe(method(navigationItemDidUpdate))]
101        #[unsafe(method_family = none)]
102        pub fn navigationItemDidUpdate(&self);
103
104        #[cfg(feature = "block2")]
105        /// Opens the current document.
106        /// 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.
107        /// If the document is already opened, the completion handler will be called as if opening the document succeeded.
108        #[unsafe(method(openDocumentWithCompletionHandler:))]
109        #[unsafe(method_family = none)]
110        pub fn openDocumentWithCompletionHandler(
111            &self,
112            completion_handler: &block2::DynBlock<dyn Fn(Bool)>,
113        );
114
115        /// Notifies subclasses that the specified document was opened. This method will be called by the system after
116        /// opening the document initially or after the presented document was changed.
117        #[unsafe(method(documentDidOpen))]
118        #[unsafe(method_family = none)]
119        pub fn documentDidOpen(&self);
120
121        #[cfg(feature = "UIBarButtonItemGroup")]
122        /// MARK: Custom Navigation Items
123        #[unsafe(method(undoRedoItemGroup))]
124        #[unsafe(method_family = none)]
125        pub fn undoRedoItemGroup(&self) -> Retained<UIBarButtonItemGroup>;
126    );
127}
128
129/// Methods declared on superclass `UIViewController`.
130#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
131impl UIDocumentViewController {
132    extern_methods!(
133        #[unsafe(method(initWithNibName:bundle:))]
134        #[unsafe(method_family = init)]
135        pub fn initWithNibName_bundle(
136            this: Allocated<Self>,
137            nib_name_or_nil: Option<&NSString>,
138            nib_bundle_or_nil: Option<&NSBundle>,
139        ) -> Retained<Self>;
140
141        /// # Safety
142        ///
143        /// `coder` possibly has further requirements.
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 fn init(this: Allocated<Self>) -> Retained<Self>;
160
161        #[unsafe(method(new))]
162        #[unsafe(method_family = new)]
163        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
164    );
165}