objc2_web_kit/generated/
DOMKeyboardEvent.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
10/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_key_location_standard?language=objc)
11#[deprecated]
12pub const DOM_KEY_LOCATION_STANDARD: c_uint = 0x00;
13/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_key_location_left?language=objc)
14#[deprecated]
15pub const DOM_KEY_LOCATION_LEFT: c_uint = 0x01;
16/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_key_location_right?language=objc)
17#[deprecated]
18pub const DOM_KEY_LOCATION_RIGHT: c_uint = 0x02;
19/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_key_location_numpad?language=objc)
20#[deprecated]
21pub const DOM_KEY_LOCATION_NUMPAD: c_uint = 0x03;
22
23extern_class!(
24    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/domkeyboardevent?language=objc)
25    #[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]
124        #[unsafe(method(getModifierState:))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn getModifierState(&self, key_identifier_arg: Option<&NSString>) -> bool;
127
128        #[cfg(feature = "DOMAbstractView")]
129        #[unsafe(method(initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:location:ctrlKey:altKey:shiftKey:metaKey:altGraphKey:))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn initKeyboardEvent_canBubble_cancelable_view_keyIdentifier_location_ctrlKey_altKey_shiftKey_metaKey_altGraphKey(
132            &self,
133            r#type: Option<&NSString>,
134            can_bubble: bool,
135            cancelable: bool,
136            view: Option<&DOMAbstractView>,
137            key_identifier: Option<&NSString>,
138            location: c_uint,
139            ctrl_key: bool,
140            alt_key: bool,
141            shift_key: bool,
142            meta_key: bool,
143            alt_graph_key: bool,
144        );
145
146        #[cfg(feature = "DOMAbstractView")]
147        #[unsafe(method(initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:location:ctrlKey:altKey:shiftKey:metaKey:))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn initKeyboardEvent_canBubble_cancelable_view_keyIdentifier_location_ctrlKey_altKey_shiftKey_metaKey(
150            &self,
151            r#type: Option<&NSString>,
152            can_bubble: bool,
153            cancelable: bool,
154            view: Option<&DOMAbstractView>,
155            key_identifier: Option<&NSString>,
156            location: c_uint,
157            ctrl_key: bool,
158            alt_key: bool,
159            shift_key: bool,
160            meta_key: bool,
161        );
162
163        #[cfg(feature = "DOMAbstractView")]
164        #[deprecated]
165        #[unsafe(method(initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:keyLocation:ctrlKey:altKey:shiftKey:metaKey:altGraphKey:))]
166        #[unsafe(method_family = none)]
167        pub unsafe fn initKeyboardEvent_canBubble_cancelable_view_keyIdentifier_keyLocation_ctrlKey_altKey_shiftKey_metaKey_altGraphKey(
168            &self,
169            r#type: Option<&NSString>,
170            can_bubble: bool,
171            cancelable: bool,
172            view: Option<&DOMAbstractView>,
173            key_identifier: Option<&NSString>,
174            key_location: c_uint,
175            ctrl_key: bool,
176            alt_key: bool,
177            shift_key: bool,
178            meta_key: bool,
179            alt_graph_key: bool,
180        );
181
182        #[cfg(feature = "DOMAbstractView")]
183        #[deprecated]
184        #[unsafe(method(initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:keyLocation:ctrlKey:altKey:shiftKey:metaKey:))]
185        #[unsafe(method_family = none)]
186        pub unsafe fn initKeyboardEvent_canBubble_cancelable_view_keyIdentifier_keyLocation_ctrlKey_altKey_shiftKey_metaKey(
187            &self,
188            r#type: Option<&NSString>,
189            can_bubble: bool,
190            cancelable: bool,
191            view: Option<&DOMAbstractView>,
192            key_identifier: Option<&NSString>,
193            key_location: c_uint,
194            ctrl_key: bool,
195            alt_key: bool,
196            shift_key: bool,
197            meta_key: bool,
198        );
199    );
200}
201
202/// Methods declared on superclass `DOMObject`.
203#[cfg(all(
204    feature = "DOMEvent",
205    feature = "DOMObject",
206    feature = "DOMUIEvent",
207    feature = "WebScriptObject"
208))]
209impl DOMKeyboardEvent {
210    extern_methods!(
211        #[deprecated]
212        #[unsafe(method(init))]
213        #[unsafe(method_family = init)]
214        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
215    );
216}
217
218/// Methods declared on superclass `NSObject`.
219#[cfg(all(
220    feature = "DOMEvent",
221    feature = "DOMObject",
222    feature = "DOMUIEvent",
223    feature = "WebScriptObject"
224))]
225impl DOMKeyboardEvent {
226    extern_methods!(
227        #[unsafe(method(new))]
228        #[unsafe(method_family = new)]
229        pub unsafe fn new() -> Retained<Self>;
230    );
231}