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"))]
33unsafe impl NSCopying for DOMEvent {}
34
35#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
36unsafe impl CopyingHelper for DOMEvent {
37 type Result = Self;
38}
39
40#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
41unsafe impl NSObjectProtocol for DOMEvent {}
42
43#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
44impl DOMEvent {
45 extern_methods!(
46 #[deprecated]
47 #[unsafe(method(type))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn r#type(&self) -> Retained<NSString>;
50
51 #[cfg(feature = "DOMEventTarget")]
52 #[deprecated]
53 #[unsafe(method(target))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn target(&self) -> Option<Retained<ProtocolObject<dyn DOMEventTarget>>>;
56
57 #[cfg(feature = "DOMEventTarget")]
58 #[deprecated]
59 #[unsafe(method(currentTarget))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn currentTarget(&self) -> Option<Retained<ProtocolObject<dyn DOMEventTarget>>>;
62
63 #[deprecated]
64 #[unsafe(method(eventPhase))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn eventPhase(&self) -> c_ushort;
67
68 #[deprecated]
69 #[unsafe(method(bubbles))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn bubbles(&self) -> bool;
72
73 #[deprecated]
74 #[unsafe(method(cancelable))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn cancelable(&self) -> bool;
77
78 #[deprecated]
79 #[unsafe(method(timeStamp))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn timeStamp(&self) -> DOMTimeStamp;
82
83 #[cfg(feature = "DOMEventTarget")]
84 #[unsafe(method(srcElement))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn srcElement(&self) -> Option<Retained<ProtocolObject<dyn DOMEventTarget>>>;
87
88 #[unsafe(method(returnValue))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn returnValue(&self) -> bool;
91
92 #[unsafe(method(setReturnValue:))]
94 #[unsafe(method_family = none)]
95 pub unsafe fn setReturnValue(&self, return_value: bool);
96
97 #[unsafe(method(cancelBubble))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn cancelBubble(&self) -> bool;
100
101 #[unsafe(method(setCancelBubble:))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn setCancelBubble(&self, cancel_bubble: bool);
105
106 #[deprecated]
107 #[unsafe(method(stopPropagation))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn stopPropagation(&self);
110
111 #[deprecated]
112 #[unsafe(method(preventDefault))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn preventDefault(&self);
115
116 #[unsafe(method(initEvent:canBubbleArg:cancelableArg:))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn initEvent_canBubbleArg_cancelableArg(
119 &self,
120 event_type_arg: Option<&NSString>,
121 can_bubble_arg: bool,
122 cancelable_arg: bool,
123 );
124 );
125}
126
127#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
129impl DOMEvent {
130 extern_methods!(
131 #[deprecated]
132 #[unsafe(method(init))]
133 #[unsafe(method_family = init)]
134 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
135 );
136}
137
138#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
140impl DOMEvent {
141 extern_methods!(
142 #[unsafe(method(new))]
143 #[unsafe(method_family = new)]
144 pub unsafe fn new() -> Retained<Self>;
145 );
146}
147
148#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
150impl DOMEvent {
151 extern_methods!(
152 #[deprecated]
153 #[unsafe(method(initEvent:::))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn initEvent(
156 &self,
157 event_type_arg: Option<&NSString>,
158 can_bubble_arg: bool,
159 cancelable_arg: bool,
160 );
161 );
162}