objc2_app_kit/generated/
NSInputManager.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11 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 #[unsafe(super(NSObject))]
85 #[derive(Debug, PartialEq, Eq, Hash)]
86 #[deprecated = "Use NSTextInputContext instead"]
87 pub struct NSInputManager;
88);
89
90unsafe impl NSObjectProtocol for NSInputManager {}
91
92unsafe impl NSTextInput for NSInputManager {}
93
94impl NSInputManager {
95 extern_methods!(
96 #[deprecated]
97 #[unsafe(method(currentInputManager))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn currentInputManager() -> Option<Retained<NSInputManager>>;
100
101 #[deprecated]
102 #[unsafe(method(cycleToNextInputLanguage:))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn cycleToNextInputLanguage(sender: Option<&AnyObject>);
105
106 #[deprecated]
107 #[unsafe(method(cycleToNextInputServerInLanguage:))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn cycleToNextInputServerInLanguage(sender: Option<&AnyObject>);
110
111 #[deprecated]
112 #[unsafe(method(initWithName:host:))]
113 #[unsafe(method_family = init)]
114 pub unsafe fn initWithName_host(
115 this: Allocated<Self>,
116 input_server_name: Option<&NSString>,
117 host_name: Option<&NSString>,
118 ) -> Option<Retained<NSInputManager>>;
119
120 #[deprecated]
121 #[unsafe(method(localizedInputManagerName))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn localizedInputManagerName(&self) -> Option<Retained<NSString>>;
124
125 #[deprecated]
126 #[unsafe(method(markedTextAbandoned:))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn markedTextAbandoned(&self, cli: Option<&AnyObject>);
129
130 #[deprecated]
131 #[unsafe(method(markedTextSelectionChanged:client:))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn markedTextSelectionChanged_client(
134 &self,
135 new_sel: NSRange,
136 cli: Option<&AnyObject>,
137 );
138
139 #[deprecated]
140 #[unsafe(method(wantsToInterpretAllKeystrokes))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn wantsToInterpretAllKeystrokes(&self) -> bool;
143
144 #[deprecated]
145 #[unsafe(method(language))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn language(&self) -> Option<Retained<NSString>>;
148
149 #[cfg(feature = "NSImage")]
150 #[deprecated]
151 #[unsafe(method(image))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn image(&self) -> Option<Retained<NSImage>>;
154
155 #[cfg(feature = "NSInputServer")]
156 #[deprecated]
157 #[unsafe(method(server))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn server(&self) -> Option<Retained<NSInputServer>>;
160
161 #[deprecated]
162 #[unsafe(method(wantsToHandleMouseEvents))]
163 #[unsafe(method_family = none)]
164 pub unsafe fn wantsToHandleMouseEvents(&self) -> bool;
165
166 #[cfg(feature = "NSEvent")]
167 #[deprecated]
168 #[unsafe(method(handleMouseEvent:))]
169 #[unsafe(method_family = none)]
170 pub unsafe fn handleMouseEvent(&self, mouse_event: Option<&NSEvent>) -> bool;
171
172 #[deprecated]
173 #[unsafe(method(wantsToDelayTextChangeNotifications))]
174 #[unsafe(method_family = none)]
175 pub unsafe fn wantsToDelayTextChangeNotifications(&self) -> bool;
176 );
177}
178
179impl NSInputManager {
181 extern_methods!(
182 #[unsafe(method(init))]
183 #[unsafe(method_family = init)]
184 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
185
186 #[unsafe(method(new))]
187 #[unsafe(method_family = new)]
188 pub unsafe fn new() -> Retained<Self>;
189 );
190}