objc2_app_kit/generated/
NSInputManager.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/appkit/nstextinput?language=objc)
12    pub unsafe trait NSTextInput {
13        /// # Safety
14        ///
15        /// - `string` should be of the correct type.
16        /// - `string` might not allow `None`.
17        #[deprecated]
18        #[unsafe(method(insertText:))]
19        #[unsafe(method_family = none)]
20        unsafe fn insertText(&self, string: Option<&AnyObject>);
21
22        /// # Safety
23        ///
24        /// `selector` must be a valid selector.
25        #[deprecated]
26        #[unsafe(method(doCommandBySelector:))]
27        #[unsafe(method_family = none)]
28        unsafe fn doCommandBySelector(&self, selector: Option<Sel>);
29
30        /// # Safety
31        ///
32        /// - `string` should be of the correct type.
33        /// - `string` might not allow `None`.
34        #[deprecated]
35        #[unsafe(method(setMarkedText:selectedRange:))]
36        #[unsafe(method_family = none)]
37        unsafe fn setMarkedText_selectedRange(
38            &self,
39            string: Option<&AnyObject>,
40            sel_range: NSRange,
41        );
42
43        #[deprecated]
44        #[unsafe(method(unmarkText))]
45        #[unsafe(method_family = none)]
46        fn unmarkText(&self);
47
48        #[deprecated]
49        #[unsafe(method(hasMarkedText))]
50        #[unsafe(method_family = none)]
51        fn hasMarkedText(&self) -> bool;
52
53        #[deprecated]
54        #[unsafe(method(conversationIdentifier))]
55        #[unsafe(method_family = none)]
56        fn conversationIdentifier(&self) -> NSInteger;
57
58        #[deprecated]
59        #[unsafe(method(attributedSubstringFromRange:))]
60        #[unsafe(method_family = none)]
61        fn attributedSubstringFromRange(
62            &self,
63            range: NSRange,
64        ) -> Option<Retained<NSAttributedString>>;
65
66        #[deprecated]
67        #[unsafe(method(markedRange))]
68        #[unsafe(method_family = none)]
69        fn markedRange(&self) -> NSRange;
70
71        #[deprecated]
72        #[unsafe(method(selectedRange))]
73        #[unsafe(method_family = none)]
74        fn selectedRange(&self) -> NSRange;
75
76        #[deprecated]
77        #[unsafe(method(firstRectForCharacterRange:))]
78        #[unsafe(method_family = none)]
79        fn firstRectForCharacterRange(&self, range: NSRange) -> NSRect;
80
81        #[deprecated]
82        #[unsafe(method(characterIndexForPoint:))]
83        #[unsafe(method_family = none)]
84        fn characterIndexForPoint(&self, point: NSPoint) -> NSUInteger;
85
86        #[deprecated]
87        #[unsafe(method(validAttributesForMarkedText))]
88        #[unsafe(method_family = none)]
89        fn validAttributesForMarkedText(&self) -> Option<Retained<NSArray>>;
90    }
91);
92
93extern_class!(
94    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsinputmanager?language=objc)
95    #[unsafe(super(NSObject))]
96    #[derive(Debug, PartialEq, Eq, Hash)]
97    #[deprecated = "Use NSTextInputContext instead"]
98    pub struct NSInputManager;
99);
100
101extern_conformance!(
102    unsafe impl NSObjectProtocol for NSInputManager {}
103);
104
105extern_conformance!(
106    unsafe impl NSTextInput for NSInputManager {}
107);
108
109impl NSInputManager {
110    extern_methods!(
111        #[deprecated]
112        #[unsafe(method(currentInputManager))]
113        #[unsafe(method_family = none)]
114        pub fn currentInputManager() -> Option<Retained<NSInputManager>>;
115
116        /// # Safety
117        ///
118        /// `sender` should be of the correct type.
119        #[deprecated]
120        #[unsafe(method(cycleToNextInputLanguage:))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn cycleToNextInputLanguage(sender: Option<&AnyObject>);
123
124        /// # Safety
125        ///
126        /// `sender` should be of the correct type.
127        #[deprecated]
128        #[unsafe(method(cycleToNextInputServerInLanguage:))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn cycleToNextInputServerInLanguage(sender: Option<&AnyObject>);
131
132        /// # Safety
133        ///
134        /// - `input_server_name` might not allow `None`.
135        /// - `host_name` might not allow `None`.
136        #[deprecated]
137        #[unsafe(method(initWithName:host:))]
138        #[unsafe(method_family = init)]
139        pub unsafe fn initWithName_host(
140            this: Allocated<Self>,
141            input_server_name: Option<&NSString>,
142            host_name: Option<&NSString>,
143        ) -> Option<Retained<NSInputManager>>;
144
145        #[deprecated]
146        #[unsafe(method(localizedInputManagerName))]
147        #[unsafe(method_family = none)]
148        pub fn localizedInputManagerName(&self) -> Option<Retained<NSString>>;
149
150        /// # Safety
151        ///
152        /// - `cli` should be of the correct type.
153        /// - `cli` might not allow `None`.
154        #[deprecated]
155        #[unsafe(method(markedTextAbandoned:))]
156        #[unsafe(method_family = none)]
157        pub unsafe fn markedTextAbandoned(&self, cli: Option<&AnyObject>);
158
159        /// # Safety
160        ///
161        /// - `cli` should be of the correct type.
162        /// - `cli` might not allow `None`.
163        #[deprecated]
164        #[unsafe(method(markedTextSelectionChanged:client:))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn markedTextSelectionChanged_client(
167            &self,
168            new_sel: NSRange,
169            cli: Option<&AnyObject>,
170        );
171
172        #[deprecated]
173        #[unsafe(method(wantsToInterpretAllKeystrokes))]
174        #[unsafe(method_family = none)]
175        pub fn wantsToInterpretAllKeystrokes(&self) -> bool;
176
177        #[deprecated]
178        #[unsafe(method(language))]
179        #[unsafe(method_family = none)]
180        pub fn language(&self) -> Option<Retained<NSString>>;
181
182        #[cfg(feature = "NSImage")]
183        #[deprecated]
184        #[unsafe(method(image))]
185        #[unsafe(method_family = none)]
186        pub fn image(&self) -> Option<Retained<NSImage>>;
187
188        #[cfg(feature = "NSInputServer")]
189        #[deprecated]
190        #[unsafe(method(server))]
191        #[unsafe(method_family = none)]
192        pub fn server(&self) -> Option<Retained<NSInputServer>>;
193
194        #[deprecated]
195        #[unsafe(method(wantsToHandleMouseEvents))]
196        #[unsafe(method_family = none)]
197        pub fn wantsToHandleMouseEvents(&self) -> bool;
198
199        #[cfg(feature = "NSEvent")]
200        /// # Safety
201        ///
202        /// `mouse_event` might not allow `None`.
203        #[deprecated]
204        #[unsafe(method(handleMouseEvent:))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn handleMouseEvent(&self, mouse_event: Option<&NSEvent>) -> bool;
207
208        #[deprecated]
209        #[unsafe(method(wantsToDelayTextChangeNotifications))]
210        #[unsafe(method_family = none)]
211        pub fn wantsToDelayTextChangeNotifications(&self) -> bool;
212    );
213}
214
215/// Methods declared on superclass `NSObject`.
216impl NSInputManager {
217    extern_methods!(
218        #[unsafe(method(init))]
219        #[unsafe(method_family = init)]
220        pub fn init(this: Allocated<Self>) -> Retained<Self>;
221
222        #[unsafe(method(new))]
223        #[unsafe(method_family = new)]
224        pub fn new() -> Retained<Self>;
225    );
226}
227
228impl DefaultRetained for NSInputManager {
229    #[inline]
230    fn default_retained() -> Retained<Self> {
231        Self::new()
232    }
233}