objc2_web_kit/generated/
DOMKeyboardEvent.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[deprecated]
12pub const DOM_KEY_LOCATION_STANDARD: c_uint = 0x00;
13#[deprecated]
15pub const DOM_KEY_LOCATION_LEFT: c_uint = 0x01;
16#[deprecated]
18pub const DOM_KEY_LOCATION_RIGHT: c_uint = 0x02;
19#[deprecated]
21pub const DOM_KEY_LOCATION_NUMPAD: c_uint = 0x03;
22
23extern_class!(
24 #[unsafe(super(DOMUIEvent, DOMEvent, DOMObject, WebScriptObject, NSObject))]
26 #[derive(Debug, PartialEq, Eq, Hash)]
27 #[cfg(all(
28 feature = "DOMEvent",
29 feature = "DOMObject",
30 feature = "DOMUIEvent",
31 feature = "WebScriptObject"
32 ))]
33 #[deprecated]
34 pub struct DOMKeyboardEvent;
35);
36
37#[cfg(all(
38 feature = "DOMEvent",
39 feature = "DOMObject",
40 feature = "DOMUIEvent",
41 feature = "WebScriptObject"
42))]
43extern_conformance!(
44 unsafe impl NSCopying for DOMKeyboardEvent {}
45);
46
47#[cfg(all(
48 feature = "DOMEvent",
49 feature = "DOMObject",
50 feature = "DOMUIEvent",
51 feature = "WebScriptObject"
52))]
53unsafe impl CopyingHelper for DOMKeyboardEvent {
54 type Result = Self;
55}
56
57#[cfg(all(
58 feature = "DOMEvent",
59 feature = "DOMObject",
60 feature = "DOMUIEvent",
61 feature = "WebScriptObject"
62))]
63extern_conformance!(
64 unsafe impl NSObjectProtocol for DOMKeyboardEvent {}
65);
66
67#[cfg(all(
68 feature = "DOMEvent",
69 feature = "DOMObject",
70 feature = "DOMUIEvent",
71 feature = "WebScriptObject"
72))]
73impl DOMKeyboardEvent {
74 extern_methods!(
75 #[deprecated]
76 #[unsafe(method(keyIdentifier))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn keyIdentifier(&self) -> Retained<NSString>;
79
80 #[unsafe(method(location))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn location(&self) -> c_uint;
83
84 #[deprecated]
85 #[unsafe(method(keyLocation))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn keyLocation(&self) -> c_uint;
88
89 #[deprecated]
90 #[unsafe(method(ctrlKey))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn ctrlKey(&self) -> bool;
93
94 #[deprecated]
95 #[unsafe(method(shiftKey))]
96 #[unsafe(method_family = none)]
97 pub unsafe fn shiftKey(&self) -> bool;
98
99 #[deprecated]
100 #[unsafe(method(altKey))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn altKey(&self) -> bool;
103
104 #[deprecated]
105 #[unsafe(method(metaKey))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn metaKey(&self) -> bool;
108
109 #[unsafe(method(altGraphKey))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn altGraphKey(&self) -> bool;
112
113 #[deprecated]
114 #[unsafe(method(keyCode))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn keyCode(&self) -> c_int;
117
118 #[deprecated]
119 #[unsafe(method(charCode))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn charCode(&self) -> c_int;
122
123 #[deprecated]
127 #[unsafe(method(getModifierState:))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn getModifierState(&self, key_identifier_arg: Option<&NSString>) -> bool;
130
131 #[cfg(feature = "DOMAbstractView")]
132 #[unsafe(method(initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:location:ctrlKey:altKey:shiftKey:metaKey:altGraphKey:))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn initKeyboardEvent_canBubble_cancelable_view_keyIdentifier_location_ctrlKey_altKey_shiftKey_metaKey_altGraphKey(
140 &self,
141 r#type: Option<&NSString>,
142 can_bubble: bool,
143 cancelable: bool,
144 view: Option<&DOMAbstractView>,
145 key_identifier: Option<&NSString>,
146 location: c_uint,
147 ctrl_key: bool,
148 alt_key: bool,
149 shift_key: bool,
150 meta_key: bool,
151 alt_graph_key: bool,
152 );
153
154 #[cfg(feature = "DOMAbstractView")]
155 #[unsafe(method(initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:location:ctrlKey:altKey:shiftKey:metaKey:))]
161 #[unsafe(method_family = none)]
162 pub unsafe fn initKeyboardEvent_canBubble_cancelable_view_keyIdentifier_location_ctrlKey_altKey_shiftKey_metaKey(
163 &self,
164 r#type: Option<&NSString>,
165 can_bubble: bool,
166 cancelable: bool,
167 view: Option<&DOMAbstractView>,
168 key_identifier: Option<&NSString>,
169 location: c_uint,
170 ctrl_key: bool,
171 alt_key: bool,
172 shift_key: bool,
173 meta_key: bool,
174 );
175
176 #[cfg(feature = "DOMAbstractView")]
177 #[deprecated]
183 #[unsafe(method(initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:keyLocation:ctrlKey:altKey:shiftKey:metaKey:altGraphKey:))]
184 #[unsafe(method_family = none)]
185 pub unsafe fn initKeyboardEvent_canBubble_cancelable_view_keyIdentifier_keyLocation_ctrlKey_altKey_shiftKey_metaKey_altGraphKey(
186 &self,
187 r#type: Option<&NSString>,
188 can_bubble: bool,
189 cancelable: bool,
190 view: Option<&DOMAbstractView>,
191 key_identifier: Option<&NSString>,
192 key_location: c_uint,
193 ctrl_key: bool,
194 alt_key: bool,
195 shift_key: bool,
196 meta_key: bool,
197 alt_graph_key: bool,
198 );
199
200 #[cfg(feature = "DOMAbstractView")]
201 #[deprecated]
207 #[unsafe(method(initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:keyLocation:ctrlKey:altKey:shiftKey:metaKey:))]
208 #[unsafe(method_family = none)]
209 pub unsafe fn initKeyboardEvent_canBubble_cancelable_view_keyIdentifier_keyLocation_ctrlKey_altKey_shiftKey_metaKey(
210 &self,
211 r#type: Option<&NSString>,
212 can_bubble: bool,
213 cancelable: bool,
214 view: Option<&DOMAbstractView>,
215 key_identifier: Option<&NSString>,
216 key_location: c_uint,
217 ctrl_key: bool,
218 alt_key: bool,
219 shift_key: bool,
220 meta_key: bool,
221 );
222 );
223}
224
225#[cfg(all(
227 feature = "DOMEvent",
228 feature = "DOMObject",
229 feature = "DOMUIEvent",
230 feature = "WebScriptObject"
231))]
232impl DOMKeyboardEvent {
233 extern_methods!(
234 #[deprecated]
235 #[unsafe(method(init))]
236 #[unsafe(method_family = init)]
237 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
238 );
239}
240
241#[cfg(all(
243 feature = "DOMEvent",
244 feature = "DOMObject",
245 feature = "DOMUIEvent",
246 feature = "WebScriptObject"
247))]
248impl DOMKeyboardEvent {
249 extern_methods!(
250 #[unsafe(method(new))]
251 #[unsafe(method_family = new)]
252 pub unsafe fn new() -> Retained<Self>;
253 );
254}