objc2_app_kit/generated/
NSInputServer.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/nsinputserviceprovider?language=objc)
12    pub unsafe trait NSInputServiceProvider {
13        /// # Safety
14        ///
15        /// - `string` should be of the correct type.
16        /// - `string` might not allow `None`.
17        /// - `sender` should be of the correct type.
18        /// - `sender` might not allow `None`.
19        #[deprecated]
20        #[unsafe(method(insertText:client:))]
21        #[unsafe(method_family = none)]
22        unsafe fn insertText_client(&self, string: Option<&AnyObject>, sender: Option<&AnyObject>);
23
24        /// # Safety
25        ///
26        /// - `selector` must be a valid selector.
27        /// - `sender` should be of the correct type.
28        /// - `sender` might not allow `None`.
29        #[deprecated]
30        #[unsafe(method(doCommandBySelector:client:))]
31        #[unsafe(method_family = none)]
32        unsafe fn doCommandBySelector_client(
33            &self,
34            selector: Option<Sel>,
35            sender: Option<&AnyObject>,
36        );
37
38        /// # Safety
39        ///
40        /// `sender` should be of the correct type.
41        #[deprecated]
42        #[unsafe(method(markedTextAbandoned:))]
43        #[unsafe(method_family = none)]
44        unsafe fn markedTextAbandoned(&self, sender: Option<&AnyObject>);
45
46        /// # Safety
47        ///
48        /// - `sender` should be of the correct type.
49        /// - `sender` might not allow `None`.
50        #[deprecated]
51        #[unsafe(method(markedTextSelectionChanged:client:))]
52        #[unsafe(method_family = none)]
53        unsafe fn markedTextSelectionChanged_client(
54            &self,
55            new_sel: NSRange,
56            sender: Option<&AnyObject>,
57        );
58
59        /// # Safety
60        ///
61        /// `sender` should be of the correct type.
62        #[deprecated]
63        #[unsafe(method(terminate:))]
64        #[unsafe(method_family = none)]
65        unsafe fn terminate(&self, sender: Option<&AnyObject>);
66
67        #[deprecated]
68        #[unsafe(method(canBeDisabled))]
69        #[unsafe(method_family = none)]
70        fn canBeDisabled(&self) -> bool;
71
72        #[deprecated]
73        #[unsafe(method(wantsToInterpretAllKeystrokes))]
74        #[unsafe(method_family = none)]
75        fn wantsToInterpretAllKeystrokes(&self) -> bool;
76
77        #[deprecated]
78        #[unsafe(method(wantsToHandleMouseEvents))]
79        #[unsafe(method_family = none)]
80        fn wantsToHandleMouseEvents(&self) -> bool;
81
82        #[deprecated]
83        #[unsafe(method(wantsToDelayTextChangeNotifications))]
84        #[unsafe(method_family = none)]
85        fn wantsToDelayTextChangeNotifications(&self) -> bool;
86
87        /// # Safety
88        ///
89        /// `sender` should be of the correct type.
90        #[deprecated]
91        #[unsafe(method(inputClientBecomeActive:))]
92        #[unsafe(method_family = none)]
93        unsafe fn inputClientBecomeActive(&self, sender: Option<&AnyObject>);
94
95        /// # Safety
96        ///
97        /// `sender` should be of the correct type.
98        #[deprecated]
99        #[unsafe(method(inputClientResignActive:))]
100        #[unsafe(method_family = none)]
101        unsafe fn inputClientResignActive(&self, sender: Option<&AnyObject>);
102
103        /// # Safety
104        ///
105        /// `sender` should be of the correct type.
106        #[deprecated]
107        #[unsafe(method(inputClientEnabled:))]
108        #[unsafe(method_family = none)]
109        unsafe fn inputClientEnabled(&self, sender: Option<&AnyObject>);
110
111        /// # Safety
112        ///
113        /// `sender` should be of the correct type.
114        #[deprecated]
115        #[unsafe(method(inputClientDisabled:))]
116        #[unsafe(method_family = none)]
117        unsafe fn inputClientDisabled(&self, sender: Option<&AnyObject>);
118
119        /// # Safety
120        ///
121        /// - `sender` should be of the correct type.
122        /// - `sender` might not allow `None`.
123        #[deprecated]
124        #[unsafe(method(activeConversationWillChange:fromOldConversation:))]
125        #[unsafe(method_family = none)]
126        unsafe fn activeConversationWillChange_fromOldConversation(
127            &self,
128            sender: Option<&AnyObject>,
129            old_conversation: NSInteger,
130        );
131
132        /// # Safety
133        ///
134        /// - `sender` should be of the correct type.
135        /// - `sender` might not allow `None`.
136        #[deprecated]
137        #[unsafe(method(activeConversationChanged:toNewConversation:))]
138        #[unsafe(method_family = none)]
139        unsafe fn activeConversationChanged_toNewConversation(
140            &self,
141            sender: Option<&AnyObject>,
142            new_conversation: NSInteger,
143        );
144    }
145);
146
147extern_protocol!(
148    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsinputservermousetracker?language=objc)
149    pub unsafe trait NSInputServerMouseTracker {
150        /// # Safety
151        ///
152        /// - `sender` should be of the correct type.
153        /// - `sender` might not allow `None`.
154        #[deprecated]
155        #[unsafe(method(mouseDownOnCharacterIndex:atCoordinate:withModifier:client:))]
156        #[unsafe(method_family = none)]
157        unsafe fn mouseDownOnCharacterIndex_atCoordinate_withModifier_client(
158            &self,
159            index: NSUInteger,
160            point: NSPoint,
161            flags: NSUInteger,
162            sender: Option<&AnyObject>,
163        ) -> bool;
164
165        /// # Safety
166        ///
167        /// - `sender` should be of the correct type.
168        /// - `sender` might not allow `None`.
169        #[deprecated]
170        #[unsafe(method(mouseDraggedOnCharacterIndex:atCoordinate:withModifier:client:))]
171        #[unsafe(method_family = none)]
172        unsafe fn mouseDraggedOnCharacterIndex_atCoordinate_withModifier_client(
173            &self,
174            index: NSUInteger,
175            point: NSPoint,
176            flags: NSUInteger,
177            sender: Option<&AnyObject>,
178        ) -> bool;
179
180        /// # Safety
181        ///
182        /// - `sender` should be of the correct type.
183        /// - `sender` might not allow `None`.
184        #[deprecated]
185        #[unsafe(method(mouseUpOnCharacterIndex:atCoordinate:withModifier:client:))]
186        #[unsafe(method_family = none)]
187        unsafe fn mouseUpOnCharacterIndex_atCoordinate_withModifier_client(
188            &self,
189            index: NSUInteger,
190            point: NSPoint,
191            flags: NSUInteger,
192            sender: Option<&AnyObject>,
193        );
194    }
195);
196
197extern_class!(
198    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsinputserver?language=objc)
199    #[unsafe(super(NSObject))]
200    #[derive(Debug, PartialEq, Eq, Hash)]
201    #[deprecated]
202    pub struct NSInputServer;
203);
204
205extern_conformance!(
206    unsafe impl NSInputServerMouseTracker for NSInputServer {}
207);
208
209extern_conformance!(
210    unsafe impl NSInputServiceProvider for NSInputServer {}
211);
212
213extern_conformance!(
214    unsafe impl NSObjectProtocol for NSInputServer {}
215);
216
217impl NSInputServer {
218    extern_methods!(
219        /// # Safety
220        ///
221        /// - `delegate` should be of the correct type.
222        /// - `delegate` might not allow `None`.
223        /// - `name` might not allow `None`.
224        #[deprecated]
225        #[unsafe(method(initWithDelegate:name:))]
226        #[unsafe(method_family = init)]
227        pub unsafe fn initWithDelegate_name(
228            this: Allocated<Self>,
229            delegate: Option<&AnyObject>,
230            name: Option<&NSString>,
231        ) -> Retained<Self>;
232    );
233}
234
235/// Methods declared on superclass `NSObject`.
236impl NSInputServer {
237    extern_methods!(
238        #[unsafe(method(init))]
239        #[unsafe(method_family = init)]
240        pub fn init(this: Allocated<Self>) -> Retained<Self>;
241
242        #[unsafe(method(new))]
243        #[unsafe(method_family = new)]
244        pub fn new() -> Retained<Self>;
245    );
246}
247
248impl DefaultRetained for NSInputServer {
249    #[inline]
250    fn default_retained() -> Retained<Self> {
251        Self::new()
252    }
253}