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:))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn initEvent_canBubbleArg_cancelableArg(
123 &self,
124 event_type_arg: Option<&NSString>,
125 can_bubble_arg: bool,
126 cancelable_arg: bool,
127 );
128 );
129}
130
131#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
133impl DOMEvent {
134 extern_methods!(
135 #[deprecated]
136 #[unsafe(method(init))]
137 #[unsafe(method_family = init)]
138 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
139 );
140}
141
142#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
144impl DOMEvent {
145 extern_methods!(
146 #[unsafe(method(new))]
147 #[unsafe(method_family = new)]
148 pub unsafe fn new() -> Retained<Self>;
149 );
150}
151
152#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
154impl DOMEvent {
155 extern_methods!(
156 #[deprecated]
157 #[unsafe(method(initEvent:::))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn initEvent(
160 &self,
161 event_type_arg: Option<&NSString>,
162 can_bubble_arg: bool,
163 cancelable_arg: bool,
164 );
165 );
166}