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