objc2_ui_kit/generated/
UIInputViewController.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_protocol!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextdocumentproxy?language=objc)
12    #[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    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiinputviewcontroller?language=objc)
54    #[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"))]
62unsafe impl NSCoding for UIInputViewController {}
63
64#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
65unsafe impl NSObjectProtocol for UIInputViewController {}
66
67#[cfg(all(
68    feature = "UIAppearance",
69    feature = "UIResponder",
70    feature = "UIViewController"
71))]
72unsafe impl UIAppearanceContainer for UIInputViewController {}
73
74#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
75unsafe impl UIContentContainer for UIInputViewController {}
76
77#[cfg(all(
78    feature = "UIFocus",
79    feature = "UIResponder",
80    feature = "UIViewController"
81))]
82unsafe impl UIFocusEnvironment for UIInputViewController {}
83
84#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
85unsafe impl UIResponderStandardEditActions for UIInputViewController {}
86
87#[cfg(all(
88    feature = "UIResponder",
89    feature = "UITextInput",
90    feature = "UIViewController"
91))]
92unsafe impl UITextInputDelegate for UIInputViewController {}
93
94#[cfg(all(
95    feature = "UIResponder",
96    feature = "UITraitCollection",
97    feature = "UIViewController"
98))]
99unsafe impl UITraitEnvironment for UIInputViewController {}
100
101#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
102impl UIInputViewController {
103    extern_methods!(
104        #[cfg(all(feature = "UIInputView", feature = "UIView"))]
105        #[unsafe(method(inputView))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn inputView(&self) -> Option<Retained<UIInputView>>;
108
109        #[cfg(all(feature = "UIInputView", feature = "UIView"))]
110        /// Setter for [`inputView`][Self::inputView].
111        #[unsafe(method(setInputView:))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn setInputView(&self, input_view: Option<&UIInputView>);
114
115        #[cfg(all(feature = "UITextInput", feature = "UITextInputTraits"))]
116        #[unsafe(method(textDocumentProxy))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn textDocumentProxy(&self)
119            -> Retained<ProtocolObject<dyn UITextDocumentProxy>>;
120
121        #[unsafe(method(primaryLanguage))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn primaryLanguage(&self) -> Option<Retained<NSString>>;
124
125        /// Setter for [`primaryLanguage`][Self::primaryLanguage].
126        #[unsafe(method(setPrimaryLanguage:))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn setPrimaryLanguage(&self, primary_language: Option<&NSString>);
129
130        #[unsafe(method(hasDictationKey))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn hasDictationKey(&self) -> bool;
133
134        /// Setter for [`hasDictationKey`][Self::hasDictationKey].
135        #[unsafe(method(setHasDictationKey:))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn setHasDictationKey(&self, has_dictation_key: bool);
138
139        #[unsafe(method(hasFullAccess))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn hasFullAccess(&self) -> bool;
142
143        #[unsafe(method(needsInputModeSwitchKey))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn needsInputModeSwitchKey(&self) -> bool;
146
147        #[unsafe(method(dismissKeyboard))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn dismissKeyboard(&self);
150
151        #[unsafe(method(advanceToNextInputMode))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn advanceToNextInputMode(&self);
154
155        #[cfg(all(feature = "UIEvent", feature = "UIView"))]
156        #[unsafe(method(handleInputModeListFromView:withEvent:))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn handleInputModeListFromView_withEvent(&self, view: &UIView, event: &UIEvent);
159
160        #[cfg(all(feature = "UILexicon", feature = "block2"))]
161        #[unsafe(method(requestSupplementaryLexiconWithCompletion:))]
162        #[unsafe(method_family = none)]
163        pub unsafe fn requestSupplementaryLexiconWithCompletion(
164            &self,
165            completion_handler: &block2::Block<dyn Fn(NonNull<UILexicon>)>,
166        );
167    );
168}
169
170/// Methods declared on superclass `UIViewController`.
171#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
172impl UIInputViewController {
173    extern_methods!(
174        #[unsafe(method(initWithNibName:bundle:))]
175        #[unsafe(method_family = init)]
176        pub unsafe fn initWithNibName_bundle(
177            this: Allocated<Self>,
178            nib_name_or_nil: Option<&NSString>,
179            nib_bundle_or_nil: Option<&NSBundle>,
180        ) -> Retained<Self>;
181
182        #[unsafe(method(initWithCoder:))]
183        #[unsafe(method_family = init)]
184        pub unsafe fn initWithCoder(
185            this: Allocated<Self>,
186            coder: &NSCoder,
187        ) -> Option<Retained<Self>>;
188    );
189}
190
191/// Methods declared on superclass `NSObject`.
192#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
193impl UIInputViewController {
194    extern_methods!(
195        #[unsafe(method(init))]
196        #[unsafe(method_family = init)]
197        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
198
199        #[unsafe(method(new))]
200        #[unsafe(method_family = new)]
201        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
202    );
203}