objc2_web_kit/generated/
DOMMouseEvent.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_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/dommouseevent?language=objc)
12    #[unsafe(super(DOMUIEvent, DOMEvent, DOMObject, WebScriptObject, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(all(
15        feature = "DOMEvent",
16        feature = "DOMObject",
17        feature = "DOMUIEvent",
18        feature = "WebScriptObject"
19    ))]
20    #[deprecated]
21    pub struct DOMMouseEvent;
22);
23
24#[cfg(all(
25    feature = "DOMEvent",
26    feature = "DOMObject",
27    feature = "DOMUIEvent",
28    feature = "WebScriptObject"
29))]
30extern_conformance!(
31    unsafe impl NSCopying for DOMMouseEvent {}
32);
33
34#[cfg(all(
35    feature = "DOMEvent",
36    feature = "DOMObject",
37    feature = "DOMUIEvent",
38    feature = "WebScriptObject"
39))]
40unsafe impl CopyingHelper for DOMMouseEvent {
41    type Result = Self;
42}
43
44#[cfg(all(
45    feature = "DOMEvent",
46    feature = "DOMObject",
47    feature = "DOMUIEvent",
48    feature = "WebScriptObject"
49))]
50extern_conformance!(
51    unsafe impl NSObjectProtocol for DOMMouseEvent {}
52);
53
54#[cfg(all(
55    feature = "DOMEvent",
56    feature = "DOMObject",
57    feature = "DOMUIEvent",
58    feature = "WebScriptObject"
59))]
60impl DOMMouseEvent {
61    extern_methods!(
62        #[deprecated]
63        #[unsafe(method(screenX))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn screenX(&self) -> c_int;
66
67        #[deprecated]
68        #[unsafe(method(screenY))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn screenY(&self) -> c_int;
71
72        #[deprecated]
73        #[unsafe(method(clientX))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn clientX(&self) -> c_int;
76
77        #[deprecated]
78        #[unsafe(method(clientY))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn clientY(&self) -> c_int;
81
82        #[deprecated]
83        #[unsafe(method(ctrlKey))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn ctrlKey(&self) -> bool;
86
87        #[deprecated]
88        #[unsafe(method(shiftKey))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn shiftKey(&self) -> bool;
91
92        #[deprecated]
93        #[unsafe(method(altKey))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn altKey(&self) -> bool;
96
97        #[deprecated]
98        #[unsafe(method(metaKey))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn metaKey(&self) -> bool;
101
102        #[deprecated]
103        #[unsafe(method(button))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn button(&self) -> c_short;
106
107        #[cfg(feature = "DOMEventTarget")]
108        #[deprecated]
109        #[unsafe(method(relatedTarget))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn relatedTarget(&self) -> Option<Retained<ProtocolObject<dyn DOMEventTarget>>>;
112
113        #[unsafe(method(offsetX))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn offsetX(&self) -> c_int;
116
117        #[unsafe(method(offsetY))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn offsetY(&self) -> c_int;
120
121        #[unsafe(method(x))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn x(&self) -> c_int;
124
125        #[unsafe(method(y))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn y(&self) -> c_int;
128
129        #[cfg(feature = "DOMNode")]
130        #[unsafe(method(fromElement))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn fromElement(&self) -> Option<Retained<DOMNode>>;
133
134        #[cfg(feature = "DOMNode")]
135        #[unsafe(method(toElement))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn toElement(&self) -> Option<Retained<DOMNode>>;
138
139        #[cfg(all(feature = "DOMAbstractView", feature = "DOMEventTarget"))]
140        /// # Safety
141        ///
142        /// - `type` might not allow `None`.
143        /// - `view` might not allow `None`.
144        /// - `related_target` might not allow `None`.
145        #[unsafe(method(initMouseEvent:canBubble:cancelable:view:detail:screenX:screenY:clientX:clientY:ctrlKey:altKey:shiftKey:metaKey:button:relatedTarget:))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn initMouseEvent_canBubble_cancelable_view_detail_screenX_screenY_clientX_clientY_ctrlKey_altKey_shiftKey_metaKey_button_relatedTarget(
148            &self,
149            r#type: Option<&NSString>,
150            can_bubble: bool,
151            cancelable: bool,
152            view: Option<&DOMAbstractView>,
153            detail: c_int,
154            screen_x: c_int,
155            screen_y: c_int,
156            client_x: c_int,
157            client_y: c_int,
158            ctrl_key: bool,
159            alt_key: bool,
160            shift_key: bool,
161            meta_key: bool,
162            button: c_ushort,
163            related_target: Option<&ProtocolObject<dyn DOMEventTarget>>,
164        );
165    );
166}
167
168/// Methods declared on superclass `DOMObject`.
169#[cfg(all(
170    feature = "DOMEvent",
171    feature = "DOMObject",
172    feature = "DOMUIEvent",
173    feature = "WebScriptObject"
174))]
175impl DOMMouseEvent {
176    extern_methods!(
177        #[deprecated]
178        #[unsafe(method(init))]
179        #[unsafe(method_family = init)]
180        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
181    );
182}
183
184/// Methods declared on superclass `NSObject`.
185#[cfg(all(
186    feature = "DOMEvent",
187    feature = "DOMObject",
188    feature = "DOMUIEvent",
189    feature = "WebScriptObject"
190))]
191impl DOMMouseEvent {
192    extern_methods!(
193        #[unsafe(method(new))]
194        #[unsafe(method_family = new)]
195        pub unsafe fn new() -> Retained<Self>;
196    );
197}
198
199/// DOMMouseEventDeprecated.
200#[deprecated]
201#[cfg(all(
202    feature = "DOMEvent",
203    feature = "DOMObject",
204    feature = "DOMUIEvent",
205    feature = "WebScriptObject"
206))]
207impl DOMMouseEvent {
208    extern_methods!(
209        #[cfg(all(feature = "DOMAbstractView", feature = "DOMEventTarget"))]
210        /// # Safety
211        ///
212        /// - `type` might not allow `None`.
213        /// - `view` might not allow `None`.
214        /// - `related_target` might not allow `None`.
215        #[deprecated]
216        #[unsafe(method(initMouseEvent:::::::::::::::))]
217        #[unsafe(method_family = none)]
218        pub unsafe fn initMouseEvent(
219            &self,
220            r#type: Option<&NSString>,
221            can_bubble: bool,
222            cancelable: bool,
223            view: Option<&DOMAbstractView>,
224            detail: c_int,
225            screen_x: c_int,
226            screen_y: c_int,
227            client_x: c_int,
228            client_y: c_int,
229            ctrl_key: bool,
230            alt_key: bool,
231            shift_key: bool,
232            meta_key: bool,
233            button: c_ushort,
234            related_target: Option<&ProtocolObject<dyn DOMEventTarget>>,
235        );
236    );
237}