1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[deprecated]
12pub const DOM_ALLOW_KEYBOARD_INPUT: c_uint = 1;
13
14extern_class!(
15 #[unsafe(super(DOMNode, DOMObject, WebScriptObject, NSObject))]
17 #[derive(Debug, PartialEq, Eq, Hash)]
18 #[cfg(all(
19 feature = "DOMNode",
20 feature = "DOMObject",
21 feature = "WebScriptObject"
22 ))]
23 #[deprecated]
24 pub struct DOMElement;
25);
26
27#[cfg(all(
28 feature = "DOMEventTarget",
29 feature = "DOMNode",
30 feature = "DOMObject",
31 feature = "WebScriptObject"
32))]
33unsafe impl DOMEventTarget for DOMElement {}
34
35#[cfg(all(
36 feature = "DOMNode",
37 feature = "DOMObject",
38 feature = "WebScriptObject"
39))]
40unsafe impl NSCopying for DOMElement {}
41
42#[cfg(all(
43 feature = "DOMNode",
44 feature = "DOMObject",
45 feature = "WebScriptObject"
46))]
47unsafe impl CopyingHelper for DOMElement {
48 type Result = Self;
49}
50
51#[cfg(all(
52 feature = "DOMNode",
53 feature = "DOMObject",
54 feature = "WebScriptObject"
55))]
56unsafe impl NSObjectProtocol for DOMElement {}
57
58#[cfg(all(
59 feature = "DOMNode",
60 feature = "DOMObject",
61 feature = "WebScriptObject"
62))]
63impl DOMElement {
64 extern_methods!(
65 #[deprecated]
66 #[unsafe(method(tagName))]
67 #[unsafe(method_family = none)]
68 pub unsafe fn tagName(&self) -> Retained<NSString>;
69
70 #[cfg(feature = "DOMCSSStyleDeclaration")]
71 #[deprecated]
72 #[unsafe(method(style))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn style(&self) -> Option<Retained<DOMCSSStyleDeclaration>>;
75
76 #[deprecated]
77 #[unsafe(method(offsetLeft))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn offsetLeft(&self) -> c_int;
80
81 #[deprecated]
82 #[unsafe(method(offsetTop))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn offsetTop(&self) -> c_int;
85
86 #[deprecated]
87 #[unsafe(method(offsetWidth))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn offsetWidth(&self) -> c_int;
90
91 #[deprecated]
92 #[unsafe(method(offsetHeight))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn offsetHeight(&self) -> c_int;
95
96 #[unsafe(method(clientLeft))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn clientLeft(&self) -> c_int;
99
100 #[unsafe(method(clientTop))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn clientTop(&self) -> c_int;
103
104 #[deprecated]
105 #[unsafe(method(clientWidth))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn clientWidth(&self) -> c_int;
108
109 #[deprecated]
110 #[unsafe(method(clientHeight))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn clientHeight(&self) -> c_int;
113
114 #[deprecated]
115 #[unsafe(method(scrollLeft))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn scrollLeft(&self) -> c_int;
118
119 #[deprecated]
121 #[unsafe(method(setScrollLeft:))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn setScrollLeft(&self, scroll_left: c_int);
124
125 #[deprecated]
126 #[unsafe(method(scrollTop))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn scrollTop(&self) -> c_int;
129
130 #[deprecated]
132 #[unsafe(method(setScrollTop:))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn setScrollTop(&self, scroll_top: c_int);
135
136 #[deprecated]
137 #[unsafe(method(scrollWidth))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn scrollWidth(&self) -> c_int;
140
141 #[deprecated]
142 #[unsafe(method(scrollHeight))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn scrollHeight(&self) -> c_int;
145
146 #[deprecated]
147 #[unsafe(method(offsetParent))]
148 #[unsafe(method_family = none)]
149 pub unsafe fn offsetParent(&self) -> Option<Retained<DOMElement>>;
150
151 #[deprecated]
152 #[unsafe(method(innerHTML))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn innerHTML(&self) -> Retained<NSString>;
155
156 #[deprecated]
158 #[unsafe(method(setInnerHTML:))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn setInnerHTML(&self, inner_html: Option<&NSString>);
161
162 #[deprecated]
163 #[unsafe(method(outerHTML))]
164 #[unsafe(method_family = none)]
165 pub unsafe fn outerHTML(&self) -> Retained<NSString>;
166
167 #[deprecated]
169 #[unsafe(method(setOuterHTML:))]
170 #[unsafe(method_family = none)]
171 pub unsafe fn setOuterHTML(&self, outer_html: Option<&NSString>);
172
173 #[deprecated]
174 #[unsafe(method(className))]
175 #[unsafe(method_family = none)]
176 pub unsafe fn className(&self) -> Retained<NSString>;
177
178 #[deprecated]
180 #[unsafe(method(setClassName:))]
181 #[unsafe(method_family = none)]
182 pub unsafe fn setClassName(&self, class_name: Option<&NSString>);
183
184 #[unsafe(method(innerText))]
185 #[unsafe(method_family = none)]
186 pub unsafe fn innerText(&self) -> Retained<NSString>;
187
188 #[unsafe(method(previousElementSibling))]
189 #[unsafe(method_family = none)]
190 pub unsafe fn previousElementSibling(&self) -> Option<Retained<DOMElement>>;
191
192 #[unsafe(method(nextElementSibling))]
193 #[unsafe(method_family = none)]
194 pub unsafe fn nextElementSibling(&self) -> Option<Retained<DOMElement>>;
195
196 #[unsafe(method(firstElementChild))]
197 #[unsafe(method_family = none)]
198 pub unsafe fn firstElementChild(&self) -> Option<Retained<DOMElement>>;
199
200 #[unsafe(method(lastElementChild))]
201 #[unsafe(method_family = none)]
202 pub unsafe fn lastElementChild(&self) -> Option<Retained<DOMElement>>;
203
204 #[unsafe(method(childElementCount))]
205 #[unsafe(method_family = none)]
206 pub unsafe fn childElementCount(&self) -> c_uint;
207
208 #[deprecated]
209 #[unsafe(method(getAttribute:))]
210 #[unsafe(method_family = none)]
211 pub unsafe fn getAttribute(&self, name: Option<&NSString>) -> Option<Retained<NSString>>;
212
213 #[unsafe(method(setAttribute:value:))]
214 #[unsafe(method_family = none)]
215 pub unsafe fn setAttribute_value(&self, name: Option<&NSString>, value: Option<&NSString>);
216
217 #[deprecated]
218 #[unsafe(method(removeAttribute:))]
219 #[unsafe(method_family = none)]
220 pub unsafe fn removeAttribute(&self, name: Option<&NSString>);
221
222 #[cfg(feature = "DOMAttr")]
223 #[deprecated]
224 #[unsafe(method(getAttributeNode:))]
225 #[unsafe(method_family = none)]
226 pub unsafe fn getAttributeNode(&self, name: Option<&NSString>)
227 -> Option<Retained<DOMAttr>>;
228
229 #[cfg(feature = "DOMAttr")]
230 #[deprecated]
231 #[unsafe(method(setAttributeNode:))]
232 #[unsafe(method_family = none)]
233 pub unsafe fn setAttributeNode(
234 &self,
235 new_attr: Option<&DOMAttr>,
236 ) -> Option<Retained<DOMAttr>>;
237
238 #[cfg(feature = "DOMAttr")]
239 #[deprecated]
240 #[unsafe(method(removeAttributeNode:))]
241 #[unsafe(method_family = none)]
242 pub unsafe fn removeAttributeNode(
243 &self,
244 old_attr: Option<&DOMAttr>,
245 ) -> Option<Retained<DOMAttr>>;
246
247 #[cfg(feature = "DOMNodeList")]
248 #[deprecated]
249 #[unsafe(method(getElementsByTagName:))]
250 #[unsafe(method_family = none)]
251 pub unsafe fn getElementsByTagName(
252 &self,
253 name: Option<&NSString>,
254 ) -> Option<Retained<DOMNodeList>>;
255
256 #[unsafe(method(getAttributeNS:localName:))]
257 #[unsafe(method_family = none)]
258 pub unsafe fn getAttributeNS_localName(
259 &self,
260 namespace_uri: Option<&NSString>,
261 local_name: Option<&NSString>,
262 ) -> Option<Retained<NSString>>;
263
264 #[unsafe(method(setAttributeNS:qualifiedName:value:))]
265 #[unsafe(method_family = none)]
266 pub unsafe fn setAttributeNS_qualifiedName_value(
267 &self,
268 namespace_uri: Option<&NSString>,
269 qualified_name: Option<&NSString>,
270 value: Option<&NSString>,
271 );
272
273 #[unsafe(method(removeAttributeNS:localName:))]
274 #[unsafe(method_family = none)]
275 pub unsafe fn removeAttributeNS_localName(
276 &self,
277 namespace_uri: Option<&NSString>,
278 local_name: Option<&NSString>,
279 );
280
281 #[cfg(feature = "DOMNodeList")]
282 #[unsafe(method(getElementsByTagNameNS:localName:))]
283 #[unsafe(method_family = none)]
284 pub unsafe fn getElementsByTagNameNS_localName(
285 &self,
286 namespace_uri: Option<&NSString>,
287 local_name: Option<&NSString>,
288 ) -> Option<Retained<DOMNodeList>>;
289
290 #[cfg(feature = "DOMAttr")]
291 #[unsafe(method(getAttributeNodeNS:localName:))]
292 #[unsafe(method_family = none)]
293 pub unsafe fn getAttributeNodeNS_localName(
294 &self,
295 namespace_uri: Option<&NSString>,
296 local_name: Option<&NSString>,
297 ) -> Option<Retained<DOMAttr>>;
298
299 #[cfg(feature = "DOMAttr")]
300 #[deprecated]
301 #[unsafe(method(setAttributeNodeNS:))]
302 #[unsafe(method_family = none)]
303 pub unsafe fn setAttributeNodeNS(
304 &self,
305 new_attr: Option<&DOMAttr>,
306 ) -> Option<Retained<DOMAttr>>;
307
308 #[deprecated]
309 #[unsafe(method(hasAttribute:))]
310 #[unsafe(method_family = none)]
311 pub unsafe fn hasAttribute(&self, name: Option<&NSString>) -> bool;
312
313 #[unsafe(method(hasAttributeNS:localName:))]
314 #[unsafe(method_family = none)]
315 pub unsafe fn hasAttributeNS_localName(
316 &self,
317 namespace_uri: Option<&NSString>,
318 local_name: Option<&NSString>,
319 ) -> bool;
320
321 #[unsafe(method(focus))]
322 #[unsafe(method_family = none)]
323 pub unsafe fn focus(&self);
324
325 #[unsafe(method(blur))]
326 #[unsafe(method_family = none)]
327 pub unsafe fn blur(&self);
328
329 #[unsafe(method(scrollIntoView:))]
330 #[unsafe(method_family = none)]
331 pub unsafe fn scrollIntoView(&self, align_with_top: bool);
332
333 #[unsafe(method(scrollIntoViewIfNeeded:))]
334 #[unsafe(method_family = none)]
335 pub unsafe fn scrollIntoViewIfNeeded(&self, center_if_needed: bool);
336
337 #[cfg(feature = "DOMNodeList")]
338 #[unsafe(method(getElementsByClassName:))]
339 #[unsafe(method_family = none)]
340 pub unsafe fn getElementsByClassName(
341 &self,
342 name: Option<&NSString>,
343 ) -> Option<Retained<DOMNodeList>>;
344
345 #[unsafe(method(webkitRequestFullScreen:))]
346 #[unsafe(method_family = none)]
347 pub unsafe fn webkitRequestFullScreen(&self, flags: c_ushort);
348
349 #[unsafe(method(querySelector:))]
350 #[unsafe(method_family = none)]
351 pub unsafe fn querySelector(
352 &self,
353 selectors: Option<&NSString>,
354 ) -> Option<Retained<DOMElement>>;
355
356 #[cfg(feature = "DOMNodeList")]
357 #[unsafe(method(querySelectorAll:))]
358 #[unsafe(method_family = none)]
359 pub unsafe fn querySelectorAll(
360 &self,
361 selectors: Option<&NSString>,
362 ) -> Option<Retained<DOMNodeList>>;
363 );
364}
365
366#[cfg(all(
368 feature = "DOMNode",
369 feature = "DOMObject",
370 feature = "WebScriptObject"
371))]
372impl DOMElement {
373 extern_methods!(
374 #[deprecated]
375 #[unsafe(method(init))]
376 #[unsafe(method_family = init)]
377 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
378 );
379}
380
381#[cfg(all(
383 feature = "DOMNode",
384 feature = "DOMObject",
385 feature = "WebScriptObject"
386))]
387impl DOMElement {
388 extern_methods!(
389 #[unsafe(method(new))]
390 #[unsafe(method_family = new)]
391 pub unsafe fn new() -> Retained<Self>;
392 );
393}
394
395#[cfg(all(
397 feature = "DOMNode",
398 feature = "DOMObject",
399 feature = "WebScriptObject"
400))]
401impl DOMElement {
402 extern_methods!(
403 #[deprecated]
404 #[unsafe(method(setAttribute::))]
405 #[unsafe(method_family = none)]
406 pub unsafe fn setAttribute(&self, name: Option<&NSString>, value: Option<&NSString>);
407
408 #[deprecated]
409 #[unsafe(method(getAttributeNS::))]
410 #[unsafe(method_family = none)]
411 pub unsafe fn getAttributeNS(
412 &self,
413 namespace_uri: Option<&NSString>,
414 local_name: Option<&NSString>,
415 ) -> Option<Retained<NSString>>;
416
417 #[deprecated]
418 #[unsafe(method(setAttributeNS:::))]
419 #[unsafe(method_family = none)]
420 pub unsafe fn setAttributeNS(
421 &self,
422 namespace_uri: Option<&NSString>,
423 qualified_name: Option<&NSString>,
424 value: Option<&NSString>,
425 );
426
427 #[deprecated]
428 #[unsafe(method(removeAttributeNS::))]
429 #[unsafe(method_family = none)]
430 pub unsafe fn removeAttributeNS(
431 &self,
432 namespace_uri: Option<&NSString>,
433 local_name: Option<&NSString>,
434 );
435
436 #[cfg(feature = "DOMNodeList")]
437 #[deprecated]
438 #[unsafe(method(getElementsByTagNameNS::))]
439 #[unsafe(method_family = none)]
440 pub unsafe fn getElementsByTagNameNS(
441 &self,
442 namespace_uri: Option<&NSString>,
443 local_name: Option<&NSString>,
444 ) -> Option<Retained<DOMNodeList>>;
445
446 #[cfg(feature = "DOMAttr")]
447 #[deprecated]
448 #[unsafe(method(getAttributeNodeNS::))]
449 #[unsafe(method_family = none)]
450 pub unsafe fn getAttributeNodeNS(
451 &self,
452 namespace_uri: Option<&NSString>,
453 local_name: Option<&NSString>,
454 ) -> Option<Retained<DOMAttr>>;
455
456 #[deprecated]
457 #[unsafe(method(hasAttributeNS::))]
458 #[unsafe(method_family = none)]
459 pub unsafe fn hasAttributeNS(
460 &self,
461 namespace_uri: Option<&NSString>,
462 local_name: Option<&NSString>,
463 ) -> bool;
464
465 #[deprecated]
466 #[unsafe(method(scrollByLines:))]
467 #[unsafe(method_family = none)]
468 pub unsafe fn scrollByLines(&self, lines: c_int);
469
470 #[deprecated]
471 #[unsafe(method(scrollByPages:))]
472 #[unsafe(method_family = none)]
473 pub unsafe fn scrollByPages(&self, pages: c_int);
474 );
475}