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