objc2_ui_kit/generated/
UIInputViewController.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11 #[cfg(all(feature = "UITextInput", feature = "UITextInputTraits"))]
13 pub unsafe trait UITextDocumentProxy: UIKeyInput + MainThreadOnly {
14 #[unsafe(method(documentContextBeforeInput))]
15 #[unsafe(method_family = none)]
16 fn documentContextBeforeInput(&self) -> Option<Retained<NSString>>;
17
18 #[unsafe(method(documentContextAfterInput))]
19 #[unsafe(method_family = none)]
20 fn documentContextAfterInput(&self) -> Option<Retained<NSString>>;
21
22 #[unsafe(method(selectedText))]
23 #[unsafe(method_family = none)]
24 fn selectedText(&self) -> Option<Retained<NSString>>;
25
26 #[unsafe(method(documentInputMode))]
27 #[unsafe(method_family = none)]
28 fn documentInputMode(&self) -> Option<Retained<UITextInputMode>>;
29
30 #[unsafe(method(documentIdentifier))]
31 #[unsafe(method_family = none)]
32 fn documentIdentifier(&self) -> Retained<NSUUID>;
33
34 #[unsafe(method(adjustTextPositionByCharacterOffset:))]
35 #[unsafe(method_family = none)]
36 fn adjustTextPositionByCharacterOffset(&self, offset: NSInteger);
37
38 #[unsafe(method(setMarkedText:selectedRange:))]
39 #[unsafe(method_family = none)]
40 fn setMarkedText_selectedRange(&self, marked_text: &NSString, selected_range: NSRange);
41
42 #[unsafe(method(unmarkText))]
43 #[unsafe(method_family = none)]
44 fn unmarkText(&self);
45 }
46);
47
48extern_class!(
49 #[unsafe(super(UIViewController, UIResponder, NSObject))]
51 #[thread_kind = MainThreadOnly]
52 #[derive(Debug, PartialEq, Eq, Hash)]
53 #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
54 pub struct UIInputViewController;
55);
56
57#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
58extern_conformance!(
59 unsafe impl NSCoding for UIInputViewController {}
60);
61
62#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
63extern_conformance!(
64 unsafe impl NSObjectProtocol for UIInputViewController {}
65);
66
67#[cfg(all(
68 feature = "UIAppearance",
69 feature = "UIResponder",
70 feature = "UIViewController"
71))]
72extern_conformance!(
73 unsafe impl UIAppearanceContainer for UIInputViewController {}
74);
75
76#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
77extern_conformance!(
78 unsafe impl UIContentContainer for UIInputViewController {}
79);
80
81#[cfg(all(
82 feature = "UIFocus",
83 feature = "UIResponder",
84 feature = "UIViewController"
85))]
86extern_conformance!(
87 unsafe impl UIFocusEnvironment for UIInputViewController {}
88);
89
90#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
91extern_conformance!(
92 unsafe impl UIResponderStandardEditActions for UIInputViewController {}
93);
94
95#[cfg(all(
96 feature = "UIResponder",
97 feature = "UITextInput",
98 feature = "UIViewController"
99))]
100extern_conformance!(
101 unsafe impl UITextInputDelegate for UIInputViewController {}
102);
103
104#[cfg(all(
105 feature = "UIResponder",
106 feature = "UITraitCollection",
107 feature = "UIViewController"
108))]
109extern_conformance!(
110 unsafe impl UITraitEnvironment for UIInputViewController {}
111);
112
113#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
114impl UIInputViewController {
115 extern_methods!(
116 #[cfg(all(feature = "UIInputView", feature = "UIView"))]
117 #[unsafe(method(inputView))]
118 #[unsafe(method_family = none)]
119 pub fn inputView(&self) -> Option<Retained<UIInputView>>;
120
121 #[cfg(all(feature = "UIInputView", feature = "UIView"))]
122 #[unsafe(method(setInputView:))]
124 #[unsafe(method_family = none)]
125 pub fn setInputView(&self, input_view: Option<&UIInputView>);
126
127 #[cfg(all(feature = "UITextInput", feature = "UITextInputTraits"))]
128 #[unsafe(method(textDocumentProxy))]
129 #[unsafe(method_family = none)]
130 pub fn textDocumentProxy(&self) -> Retained<ProtocolObject<dyn UITextDocumentProxy>>;
131
132 #[unsafe(method(primaryLanguage))]
133 #[unsafe(method_family = none)]
134 pub fn primaryLanguage(&self) -> Option<Retained<NSString>>;
135
136 #[unsafe(method(setPrimaryLanguage:))]
140 #[unsafe(method_family = none)]
141 pub fn setPrimaryLanguage(&self, primary_language: Option<&NSString>);
142
143 #[unsafe(method(hasDictationKey))]
144 #[unsafe(method_family = none)]
145 pub fn hasDictationKey(&self) -> bool;
146
147 #[unsafe(method(setHasDictationKey:))]
149 #[unsafe(method_family = none)]
150 pub fn setHasDictationKey(&self, has_dictation_key: bool);
151
152 #[unsafe(method(hasFullAccess))]
153 #[unsafe(method_family = none)]
154 pub fn hasFullAccess(&self) -> bool;
155
156 #[unsafe(method(needsInputModeSwitchKey))]
157 #[unsafe(method_family = none)]
158 pub fn needsInputModeSwitchKey(&self) -> bool;
159
160 #[unsafe(method(dismissKeyboard))]
161 #[unsafe(method_family = none)]
162 pub fn dismissKeyboard(&self);
163
164 #[unsafe(method(advanceToNextInputMode))]
165 #[unsafe(method_family = none)]
166 pub fn advanceToNextInputMode(&self);
167
168 #[cfg(all(feature = "UIEvent", feature = "UIView"))]
169 #[unsafe(method(handleInputModeListFromView:withEvent:))]
170 #[unsafe(method_family = none)]
171 pub fn handleInputModeListFromView_withEvent(&self, view: &UIView, event: &UIEvent);
172
173 #[cfg(all(feature = "UILexicon", feature = "block2"))]
174 #[unsafe(method(requestSupplementaryLexiconWithCompletion:))]
175 #[unsafe(method_family = none)]
176 pub fn requestSupplementaryLexiconWithCompletion(
177 &self,
178 completion_handler: &block2::DynBlock<dyn Fn(NonNull<UILexicon>)>,
179 );
180 );
181}
182
183#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
185impl UIInputViewController {
186 extern_methods!(
187 #[unsafe(method(initWithNibName:bundle:))]
188 #[unsafe(method_family = init)]
189 pub fn initWithNibName_bundle(
190 this: Allocated<Self>,
191 nib_name_or_nil: Option<&NSString>,
192 nib_bundle_or_nil: Option<&NSBundle>,
193 ) -> Retained<Self>;
194
195 #[unsafe(method(initWithCoder:))]
199 #[unsafe(method_family = init)]
200 pub unsafe fn initWithCoder(
201 this: Allocated<Self>,
202 coder: &NSCoder,
203 ) -> Option<Retained<Self>>;
204 );
205}
206
207#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
209impl UIInputViewController {
210 extern_methods!(
211 #[unsafe(method(init))]
212 #[unsafe(method_family = init)]
213 pub fn init(this: Allocated<Self>) -> Retained<Self>;
214
215 #[unsafe(method(new))]
216 #[unsafe(method_family = new)]
217 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
218 );
219}