objc2_web_kit/generated/
DOMEvent.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[deprecated]
12pub const DOM_NONE: c_uint = 0;
13#[deprecated]
15pub const DOM_CAPTURING_PHASE: c_uint = 1;
16#[deprecated]
18pub const DOM_AT_TARGET: c_uint = 2;
19#[deprecated]
21pub const DOM_BUBBLING_PHASE: c_uint = 3;
22
23extern_class!(
24 #[unsafe(super(DOMObject, WebScriptObject, NSObject))]
26 #[derive(Debug, PartialEq, Eq, Hash)]
27 #[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
28 #[deprecated]
29 pub struct DOMEvent;
30);
31
32#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
33extern_conformance!(
34 unsafe impl NSCopying for DOMEvent {}
35);
36
37#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
38unsafe impl CopyingHelper for DOMEvent {
39 type Result = Self;
40}
41
42#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
43extern_conformance!(
44 unsafe impl NSObjectProtocol for DOMEvent {}
45);
46
47#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
48impl DOMEvent {
49 extern_methods!(
50 #[deprecated]
51 #[unsafe(method(type))]
52 #[unsafe(method_family = none)]
53 pub unsafe fn r#type(&self) -> Retained<NSString>;
54
55 #[cfg(feature = "DOMEventTarget")]
56 #[deprecated]
57 #[unsafe(method(target))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn target(&self) -> Option<Retained<ProtocolObject<dyn DOMEventTarget>>>;
60
61 #[cfg(feature = "DOMEventTarget")]
62 #[deprecated]
63 #[unsafe(method(currentTarget))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn currentTarget(&self) -> Option<Retained<ProtocolObject<dyn DOMEventTarget>>>;
66
67 #[deprecated]
68 #[unsafe(method(eventPhase))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn eventPhase(&self) -> c_ushort;
71
72 #[deprecated]
73 #[unsafe(method(bubbles))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn bubbles(&self) -> bool;
76
77 #[deprecated]
78 #[unsafe(method(cancelable))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn cancelable(&self) -> bool;
81
82 #[deprecated]
83 #[unsafe(method(timeStamp))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn timeStamp(&self) -> DOMTimeStamp;
86
87 #[cfg(feature = "DOMEventTarget")]
88 #[unsafe(method(srcElement))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn srcElement(&self) -> Option<Retained<ProtocolObject<dyn DOMEventTarget>>>;
91
92 #[unsafe(method(returnValue))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn returnValue(&self) -> bool;
95
96 #[unsafe(method(setReturnValue:))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn setReturnValue(&self, return_value: bool);
100
101 #[unsafe(method(cancelBubble))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn cancelBubble(&self) -> bool;
104
105 #[unsafe(method(setCancelBubble:))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn setCancelBubble(&self, cancel_bubble: bool);
109
110 #[deprecated]
111 #[unsafe(method(stopPropagation))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn stopPropagation(&self);
114
115 #[deprecated]
116 #[unsafe(method(preventDefault))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn preventDefault(&self);
119
120 #[unsafe(method(initEvent:canBubbleArg:cancelableArg:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn initEvent_canBubbleArg_cancelableArg(
126 &self,
127 event_type_arg: Option<&NSString>,
128 can_bubble_arg: bool,
129 cancelable_arg: bool,
130 );
131 );
132}
133
134#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
136impl DOMEvent {
137 extern_methods!(
138 #[deprecated]
139 #[unsafe(method(init))]
140 #[unsafe(method_family = init)]
141 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
142 );
143}
144
145#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
147impl DOMEvent {
148 extern_methods!(
149 #[unsafe(method(new))]
150 #[unsafe(method_family = new)]
151 pub unsafe fn new() -> Retained<Self>;
152 );
153}
154
155#[deprecated]
157#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
158impl DOMEvent {
159 extern_methods!(
160 #[deprecated]
164 #[unsafe(method(initEvent:::))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn initEvent(
167 &self,
168 event_type_arg: Option<&NSString>,
169 can_bubble_arg: bool,
170 cancelable_arg: bool,
171 );
172 );
173}