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