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))]
43unsafe impl NSCopying for DOMKeyboardEvent {}
44
45#[cfg(all(
46    feature = "DOMEvent",
47    feature = "DOMObject",
48    feature = "DOMUIEvent",
49    feature = "WebScriptObject"
50))]
51unsafe impl CopyingHelper for DOMKeyboardEvent {
52    type Result = Self;
53}
54
55#[cfg(all(
56    feature = "DOMEvent",
57    feature = "DOMObject",
58    feature = "DOMUIEvent",
59    feature = "WebScriptObject"
60))]
61unsafe impl NSObjectProtocol for DOMKeyboardEvent {}
62
63#[cfg(all(
64    feature = "DOMEvent",
65    feature = "DOMObject",
66    feature = "DOMUIEvent",
67    feature = "WebScriptObject"
68))]
69impl DOMKeyboardEvent {
70    extern_methods!(
71        #[deprecated]
72        #[unsafe(method(keyIdentifier))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn keyIdentifier(&self) -> Retained<NSString>;
75
76        #[unsafe(method(location))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn location(&self) -> c_uint;
79
80        #[deprecated]
81        #[unsafe(method(keyLocation))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn keyLocation(&self) -> c_uint;
84
85        #[deprecated]
86        #[unsafe(method(ctrlKey))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn ctrlKey(&self) -> bool;
89
90        #[deprecated]
91        #[unsafe(method(shiftKey))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn shiftKey(&self) -> bool;
94
95        #[deprecated]
96        #[unsafe(method(altKey))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn altKey(&self) -> bool;
99
100        #[deprecated]
101        #[unsafe(method(metaKey))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn metaKey(&self) -> bool;
104
105        #[unsafe(method(altGraphKey))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn altGraphKey(&self) -> bool;
108
109        #[deprecated]
110        #[unsafe(method(keyCode))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn keyCode(&self) -> c_int;
113
114        #[deprecated]
115        #[unsafe(method(charCode))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn charCode(&self) -> c_int;
118
119        #[deprecated]
120        #[unsafe(method(getModifierState:))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn getModifierState(&self, key_identifier_arg: Option<&NSString>) -> bool;
123
124        #[cfg(feature = "DOMAbstractView")]
125        #[unsafe(method(initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:location:ctrlKey:altKey:shiftKey:metaKey:altGraphKey:))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn initKeyboardEvent_canBubble_cancelable_view_keyIdentifier_location_ctrlKey_altKey_shiftKey_metaKey_altGraphKey(
128            &self,
129            r#type: Option<&NSString>,
130            can_bubble: bool,
131            cancelable: bool,
132            view: Option<&DOMAbstractView>,
133            key_identifier: Option<&NSString>,
134            location: c_uint,
135            ctrl_key: bool,
136            alt_key: bool,
137            shift_key: bool,
138            meta_key: bool,
139            alt_graph_key: bool,
140        );
141
142        #[cfg(feature = "DOMAbstractView")]
143        #[unsafe(method(initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:location:ctrlKey:altKey:shiftKey:metaKey:))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn initKeyboardEvent_canBubble_cancelable_view_keyIdentifier_location_ctrlKey_altKey_shiftKey_metaKey(
146            &self,
147            r#type: Option<&NSString>,
148            can_bubble: bool,
149            cancelable: bool,
150            view: Option<&DOMAbstractView>,
151            key_identifier: Option<&NSString>,
152            location: c_uint,
153            ctrl_key: bool,
154            alt_key: bool,
155            shift_key: bool,
156            meta_key: bool,
157        );
158
159        #[cfg(feature = "DOMAbstractView")]
160        #[deprecated]
161        #[unsafe(method(initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:keyLocation:ctrlKey:altKey:shiftKey:metaKey:altGraphKey:))]
162        #[unsafe(method_family = none)]
163        pub unsafe fn initKeyboardEvent_canBubble_cancelable_view_keyIdentifier_keyLocation_ctrlKey_altKey_shiftKey_metaKey_altGraphKey(
164            &self,
165            r#type: Option<&NSString>,
166            can_bubble: bool,
167            cancelable: bool,
168            view: Option<&DOMAbstractView>,
169            key_identifier: Option<&NSString>,
170            key_location: c_uint,
171            ctrl_key: bool,
172            alt_key: bool,
173            shift_key: bool,
174            meta_key: bool,
175            alt_graph_key: bool,
176        );
177
178        #[cfg(feature = "DOMAbstractView")]
179        #[deprecated]
180        #[unsafe(method(initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:keyLocation:ctrlKey:altKey:shiftKey:metaKey:))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn initKeyboardEvent_canBubble_cancelable_view_keyIdentifier_keyLocation_ctrlKey_altKey_shiftKey_metaKey(
183            &self,
184            r#type: Option<&NSString>,
185            can_bubble: bool,
186            cancelable: bool,
187            view: Option<&DOMAbstractView>,
188            key_identifier: Option<&NSString>,
189            key_location: c_uint,
190            ctrl_key: bool,
191            alt_key: bool,
192            shift_key: bool,
193            meta_key: bool,
194        );
195    );
196}
197
198/// Methods declared on superclass `DOMObject`.
199#[cfg(all(
200    feature = "DOMEvent",
201    feature = "DOMObject",
202    feature = "DOMUIEvent",
203    feature = "WebScriptObject"
204))]
205impl DOMKeyboardEvent {
206    extern_methods!(
207        #[deprecated]
208        #[unsafe(method(init))]
209        #[unsafe(method_family = init)]
210        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
211    );
212}
213
214/// Methods declared on superclass `NSObject`.
215#[cfg(all(
216    feature = "DOMEvent",
217    feature = "DOMObject",
218    feature = "DOMUIEvent",
219    feature = "WebScriptObject"
220))]
221impl DOMKeyboardEvent {
222    extern_methods!(
223        #[unsafe(method(new))]
224        #[unsafe(method_family = new)]
225        pub unsafe fn new() -> Retained<Self>;
226    );
227}