objc2_web_kit/generated/
DOMNode.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_element_node?language=objc)
11#[deprecated]
12pub const DOM_ELEMENT_NODE: c_uint = 1;
13/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_attribute_node?language=objc)
14#[deprecated]
15pub const DOM_ATTRIBUTE_NODE: c_uint = 2;
16/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_text_node?language=objc)
17#[deprecated]
18pub const DOM_TEXT_NODE: c_uint = 3;
19/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_cdata_section_node?language=objc)
20#[deprecated]
21pub const DOM_CDATA_SECTION_NODE: c_uint = 4;
22/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_entity_reference_node?language=objc)
23#[deprecated]
24pub const DOM_ENTITY_REFERENCE_NODE: c_uint = 5;
25/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_entity_node?language=objc)
26#[deprecated]
27pub const DOM_ENTITY_NODE: c_uint = 6;
28/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_processing_instruction_node?language=objc)
29#[deprecated]
30pub const DOM_PROCESSING_INSTRUCTION_NODE: c_uint = 7;
31/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_comment_node?language=objc)
32#[deprecated]
33pub const DOM_COMMENT_NODE: c_uint = 8;
34/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_document_node?language=objc)
35#[deprecated]
36pub const DOM_DOCUMENT_NODE: c_uint = 9;
37/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_document_type_node?language=objc)
38#[deprecated]
39pub const DOM_DOCUMENT_TYPE_NODE: c_uint = 10;
40/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_document_fragment_node?language=objc)
41#[deprecated]
42pub const DOM_DOCUMENT_FRAGMENT_NODE: c_uint = 11;
43/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_notation_node?language=objc)
44#[deprecated]
45pub const DOM_NOTATION_NODE: c_uint = 12;
46/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_document_position_disconnected?language=objc)
47#[deprecated]
48pub const DOM_DOCUMENT_POSITION_DISCONNECTED: c_uint = 0x01;
49/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_document_position_preceding?language=objc)
50#[deprecated]
51pub const DOM_DOCUMENT_POSITION_PRECEDING: c_uint = 0x02;
52/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_document_position_following?language=objc)
53#[deprecated]
54pub const DOM_DOCUMENT_POSITION_FOLLOWING: c_uint = 0x04;
55/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_document_position_contains?language=objc)
56#[deprecated]
57pub const DOM_DOCUMENT_POSITION_CONTAINS: c_uint = 0x08;
58/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_document_position_contained_by?language=objc)
59#[deprecated]
60pub const DOM_DOCUMENT_POSITION_CONTAINED_BY: c_uint = 0x10;
61/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_document_position_implementation_specific?language=objc)
62#[deprecated]
63pub const DOM_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: c_uint = 0x20;
64
65extern_class!(
66    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/domnode?language=objc)
67    #[unsafe(super(DOMObject, WebScriptObject, NSObject))]
68    #[derive(Debug, PartialEq, Eq, Hash)]
69    #[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
70    #[deprecated]
71    pub struct DOMNode;
72);
73
74#[cfg(all(
75    feature = "DOMEventTarget",
76    feature = "DOMObject",
77    feature = "WebScriptObject"
78))]
79extern_conformance!(
80    unsafe impl DOMEventTarget for DOMNode {}
81);
82
83#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
84extern_conformance!(
85    unsafe impl NSCopying for DOMNode {}
86);
87
88#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
89unsafe impl CopyingHelper for DOMNode {
90    type Result = Self;
91}
92
93#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
94extern_conformance!(
95    unsafe impl NSObjectProtocol for DOMNode {}
96);
97
98#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
99impl DOMNode {
100    extern_methods!(
101        #[deprecated]
102        #[unsafe(method(nodeName))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn nodeName(&self) -> Retained<NSString>;
105
106        #[deprecated]
107        #[unsafe(method(nodeValue))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn nodeValue(&self) -> Retained<NSString>;
110
111        /// Setter for [`nodeValue`][Self::nodeValue].
112        ///
113        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
114        #[deprecated]
115        #[unsafe(method(setNodeValue:))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn setNodeValue(&self, node_value: Option<&NSString>);
118
119        #[deprecated]
120        #[unsafe(method(nodeType))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn nodeType(&self) -> c_ushort;
123
124        #[deprecated]
125        #[unsafe(method(parentNode))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn parentNode(&self) -> Option<Retained<DOMNode>>;
128
129        #[cfg(feature = "DOMNodeList")]
130        #[deprecated]
131        #[unsafe(method(childNodes))]
132        #[unsafe(method_family = none)]
133        pub unsafe fn childNodes(&self) -> Option<Retained<DOMNodeList>>;
134
135        #[deprecated]
136        #[unsafe(method(firstChild))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn firstChild(&self) -> Option<Retained<DOMNode>>;
139
140        #[deprecated]
141        #[unsafe(method(lastChild))]
142        #[unsafe(method_family = none)]
143        pub unsafe fn lastChild(&self) -> Option<Retained<DOMNode>>;
144
145        #[deprecated]
146        #[unsafe(method(previousSibling))]
147        #[unsafe(method_family = none)]
148        pub unsafe fn previousSibling(&self) -> Option<Retained<DOMNode>>;
149
150        #[deprecated]
151        #[unsafe(method(nextSibling))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn nextSibling(&self) -> Option<Retained<DOMNode>>;
154
155        #[cfg(feature = "DOMDocument")]
156        #[deprecated]
157        #[unsafe(method(ownerDocument))]
158        #[unsafe(method_family = none)]
159        pub unsafe fn ownerDocument(&self) -> Option<Retained<DOMDocument>>;
160
161        #[deprecated]
162        #[unsafe(method(namespaceURI))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn namespaceURI(&self) -> Retained<NSString>;
165
166        #[deprecated]
167        #[unsafe(method(prefix))]
168        #[unsafe(method_family = none)]
169        pub unsafe fn prefix(&self) -> Retained<NSString>;
170
171        /// Setter for [`prefix`][Self::prefix].
172        ///
173        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
174        #[deprecated]
175        #[unsafe(method(setPrefix:))]
176        #[unsafe(method_family = none)]
177        pub unsafe fn setPrefix(&self, prefix: Option<&NSString>);
178
179        #[deprecated]
180        #[unsafe(method(localName))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn localName(&self) -> Retained<NSString>;
183
184        #[cfg(feature = "DOMNamedNodeMap")]
185        #[deprecated]
186        #[unsafe(method(attributes))]
187        #[unsafe(method_family = none)]
188        pub unsafe fn attributes(&self) -> Option<Retained<DOMNamedNodeMap>>;
189
190        #[unsafe(method(baseURI))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn baseURI(&self) -> Retained<NSString>;
193
194        #[unsafe(method(textContent))]
195        #[unsafe(method_family = none)]
196        pub unsafe fn textContent(&self) -> Retained<NSString>;
197
198        /// Setter for [`textContent`][Self::textContent].
199        ///
200        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
201        #[unsafe(method(setTextContent:))]
202        #[unsafe(method_family = none)]
203        pub unsafe fn setTextContent(&self, text_content: Option<&NSString>);
204
205        #[cfg(feature = "DOMElement")]
206        #[unsafe(method(parentElement))]
207        #[unsafe(method_family = none)]
208        pub unsafe fn parentElement(&self) -> Option<Retained<DOMElement>>;
209
210        #[unsafe(method(isContentEditable))]
211        #[unsafe(method_family = none)]
212        pub unsafe fn isContentEditable(&self) -> bool;
213
214        /// # Safety
215        ///
216        /// - `new_child` might not allow `None`.
217        /// - `ref_child` might not allow `None`.
218        #[unsafe(method(insertBefore:refChild:))]
219        #[unsafe(method_family = none)]
220        pub unsafe fn insertBefore_refChild(
221            &self,
222            new_child: Option<&DOMNode>,
223            ref_child: Option<&DOMNode>,
224        ) -> Option<Retained<DOMNode>>;
225
226        /// # Safety
227        ///
228        /// - `new_child` might not allow `None`.
229        /// - `old_child` might not allow `None`.
230        #[unsafe(method(replaceChild:oldChild:))]
231        #[unsafe(method_family = none)]
232        pub unsafe fn replaceChild_oldChild(
233            &self,
234            new_child: Option<&DOMNode>,
235            old_child: Option<&DOMNode>,
236        ) -> Option<Retained<DOMNode>>;
237
238        /// # Safety
239        ///
240        /// `old_child` might not allow `None`.
241        #[deprecated]
242        #[unsafe(method(removeChild:))]
243        #[unsafe(method_family = none)]
244        pub unsafe fn removeChild(&self, old_child: Option<&DOMNode>) -> Option<Retained<DOMNode>>;
245
246        /// # Safety
247        ///
248        /// `new_child` might not allow `None`.
249        #[deprecated]
250        #[unsafe(method(appendChild:))]
251        #[unsafe(method_family = none)]
252        pub unsafe fn appendChild(&self, new_child: Option<&DOMNode>) -> Option<Retained<DOMNode>>;
253
254        #[deprecated]
255        #[unsafe(method(hasChildNodes))]
256        #[unsafe(method_family = none)]
257        pub unsafe fn hasChildNodes(&self) -> bool;
258
259        #[deprecated]
260        #[unsafe(method(cloneNode:))]
261        #[unsafe(method_family = none)]
262        pub unsafe fn cloneNode(&self, deep: bool) -> Option<Retained<DOMNode>>;
263
264        #[deprecated]
265        #[unsafe(method(normalize))]
266        #[unsafe(method_family = none)]
267        pub unsafe fn normalize(&self);
268
269        /// # Safety
270        ///
271        /// - `feature` might not allow `None`.
272        /// - `version` might not allow `None`.
273        #[unsafe(method(isSupported:version:))]
274        #[unsafe(method_family = none)]
275        pub unsafe fn isSupported_version(
276            &self,
277            feature: Option<&NSString>,
278            version: Option<&NSString>,
279        ) -> bool;
280
281        #[deprecated]
282        #[unsafe(method(hasAttributes))]
283        #[unsafe(method_family = none)]
284        pub unsafe fn hasAttributes(&self) -> bool;
285
286        /// # Safety
287        ///
288        /// `other` might not allow `None`.
289        #[unsafe(method(isSameNode:))]
290        #[unsafe(method_family = none)]
291        pub unsafe fn isSameNode(&self, other: Option<&DOMNode>) -> bool;
292
293        /// # Safety
294        ///
295        /// `other` might not allow `None`.
296        #[unsafe(method(isEqualNode:))]
297        #[unsafe(method_family = none)]
298        pub unsafe fn isEqualNode(&self, other: Option<&DOMNode>) -> bool;
299
300        /// # Safety
301        ///
302        /// `namespace_uri` might not allow `None`.
303        #[unsafe(method(lookupPrefix:))]
304        #[unsafe(method_family = none)]
305        pub unsafe fn lookupPrefix(
306            &self,
307            namespace_uri: Option<&NSString>,
308        ) -> Option<Retained<NSString>>;
309
310        /// # Safety
311        ///
312        /// `prefix` might not allow `None`.
313        #[unsafe(method(lookupNamespaceURI:))]
314        #[unsafe(method_family = none)]
315        pub unsafe fn lookupNamespaceURI(
316            &self,
317            prefix: Option<&NSString>,
318        ) -> Option<Retained<NSString>>;
319
320        /// # Safety
321        ///
322        /// `namespace_uri` might not allow `None`.
323        #[unsafe(method(isDefaultNamespace:))]
324        #[unsafe(method_family = none)]
325        pub unsafe fn isDefaultNamespace(&self, namespace_uri: Option<&NSString>) -> bool;
326
327        /// # Safety
328        ///
329        /// `other` might not allow `None`.
330        #[unsafe(method(compareDocumentPosition:))]
331        #[unsafe(method_family = none)]
332        pub unsafe fn compareDocumentPosition(&self, other: Option<&DOMNode>) -> c_ushort;
333
334        /// # Safety
335        ///
336        /// `other` might not allow `None`.
337        #[unsafe(method(contains:))]
338        #[unsafe(method_family = none)]
339        pub unsafe fn contains(&self, other: Option<&DOMNode>) -> bool;
340    );
341}
342
343/// Methods declared on superclass `DOMObject`.
344#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
345impl DOMNode {
346    extern_methods!(
347        #[deprecated]
348        #[unsafe(method(init))]
349        #[unsafe(method_family = init)]
350        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
351    );
352}
353
354/// Methods declared on superclass `NSObject`.
355#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
356impl DOMNode {
357    extern_methods!(
358        #[unsafe(method(new))]
359        #[unsafe(method_family = new)]
360        pub unsafe fn new() -> Retained<Self>;
361    );
362}
363
364/// DOMNodeDeprecated.
365#[deprecated]
366#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
367impl DOMNode {
368    extern_methods!(
369        /// # Safety
370        ///
371        /// - `new_child` might not allow `None`.
372        /// - `ref_child` might not allow `None`.
373        #[deprecated]
374        #[unsafe(method(insertBefore::))]
375        #[unsafe(method_family = none)]
376        pub unsafe fn insertBefore(
377            &self,
378            new_child: Option<&DOMNode>,
379            ref_child: Option<&DOMNode>,
380        ) -> Option<Retained<DOMNode>>;
381
382        /// # Safety
383        ///
384        /// - `new_child` might not allow `None`.
385        /// - `old_child` might not allow `None`.
386        #[deprecated]
387        #[unsafe(method(replaceChild::))]
388        #[unsafe(method_family = none)]
389        pub unsafe fn replaceChild(
390            &self,
391            new_child: Option<&DOMNode>,
392            old_child: Option<&DOMNode>,
393        ) -> Option<Retained<DOMNode>>;
394
395        /// # Safety
396        ///
397        /// - `feature` might not allow `None`.
398        /// - `version` might not allow `None`.
399        #[deprecated]
400        #[unsafe(method(isSupported::))]
401        #[unsafe(method_family = none)]
402        pub unsafe fn isSupported(
403            &self,
404            feature: Option<&NSString>,
405            version: Option<&NSString>,
406        ) -> bool;
407    );
408}