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