objc2_web_kit/generated/
DOMRange.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_start_to_start?language=objc)
11#[deprecated]
12pub const DOM_START_TO_START: c_uint = 0;
13/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_start_to_end?language=objc)
14#[deprecated]
15pub const DOM_START_TO_END: c_uint = 1;
16/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_end_to_end?language=objc)
17#[deprecated]
18pub const DOM_END_TO_END: c_uint = 2;
19/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_end_to_start?language=objc)
20#[deprecated]
21pub const DOM_END_TO_START: c_uint = 3;
22/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_node_before?language=objc)
23#[deprecated]
24pub const DOM_NODE_BEFORE: c_uint = 0;
25/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_node_after?language=objc)
26#[deprecated]
27pub const DOM_NODE_AFTER: c_uint = 1;
28/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_node_before_and_after?language=objc)
29#[deprecated]
30pub const DOM_NODE_BEFORE_AND_AFTER: c_uint = 2;
31/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_node_inside?language=objc)
32#[deprecated]
33pub const DOM_NODE_INSIDE: c_uint = 3;
34
35extern_class!(
36    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/domrange?language=objc)
37    #[unsafe(super(DOMObject, WebScriptObject, NSObject))]
38    #[derive(Debug, PartialEq, Eq, Hash)]
39    #[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
40    #[deprecated]
41    pub struct DOMRange;
42);
43
44#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
45unsafe impl NSCopying for DOMRange {}
46
47#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
48unsafe impl CopyingHelper for DOMRange {
49    type Result = Self;
50}
51
52#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
53unsafe impl NSObjectProtocol for DOMRange {}
54
55#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
56impl DOMRange {
57    extern_methods!(
58        #[cfg(feature = "DOMNode")]
59        #[deprecated]
60        #[unsafe(method(startContainer))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn startContainer(&self) -> Option<Retained<DOMNode>>;
63
64        #[deprecated]
65        #[unsafe(method(startOffset))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn startOffset(&self) -> c_int;
68
69        #[cfg(feature = "DOMNode")]
70        #[deprecated]
71        #[unsafe(method(endContainer))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn endContainer(&self) -> Option<Retained<DOMNode>>;
74
75        #[deprecated]
76        #[unsafe(method(endOffset))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn endOffset(&self) -> c_int;
79
80        #[deprecated]
81        #[unsafe(method(collapsed))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn collapsed(&self) -> bool;
84
85        #[cfg(feature = "DOMNode")]
86        #[deprecated]
87        #[unsafe(method(commonAncestorContainer))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn commonAncestorContainer(&self) -> Option<Retained<DOMNode>>;
90
91        #[unsafe(method(text))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn text(&self) -> Retained<NSString>;
94
95        #[cfg(feature = "DOMNode")]
96        #[unsafe(method(setStart:offset:))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn setStart_offset(&self, ref_node: Option<&DOMNode>, offset: c_int);
99
100        #[cfg(feature = "DOMNode")]
101        #[unsafe(method(setEnd:offset:))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn setEnd_offset(&self, ref_node: Option<&DOMNode>, offset: c_int);
104
105        #[cfg(feature = "DOMNode")]
106        #[deprecated]
107        #[unsafe(method(setStartBefore:))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn setStartBefore(&self, ref_node: Option<&DOMNode>);
110
111        #[cfg(feature = "DOMNode")]
112        #[deprecated]
113        #[unsafe(method(setStartAfter:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn setStartAfter(&self, ref_node: Option<&DOMNode>);
116
117        #[cfg(feature = "DOMNode")]
118        #[deprecated]
119        #[unsafe(method(setEndBefore:))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn setEndBefore(&self, ref_node: Option<&DOMNode>);
122
123        #[cfg(feature = "DOMNode")]
124        #[deprecated]
125        #[unsafe(method(setEndAfter:))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn setEndAfter(&self, ref_node: Option<&DOMNode>);
128
129        #[deprecated]
130        #[unsafe(method(collapse:))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn collapse(&self, to_start: bool);
133
134        #[cfg(feature = "DOMNode")]
135        #[deprecated]
136        #[unsafe(method(selectNode:))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn selectNode(&self, ref_node: Option<&DOMNode>);
139
140        #[cfg(feature = "DOMNode")]
141        #[deprecated]
142        #[unsafe(method(selectNodeContents:))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn selectNodeContents(&self, ref_node: Option<&DOMNode>);
145
146        #[unsafe(method(compareBoundaryPoints:sourceRange:))]
147        #[unsafe(method_family = none)]
148        pub unsafe fn compareBoundaryPoints_sourceRange(
149            &self,
150            how: c_ushort,
151            source_range: Option<&DOMRange>,
152        ) -> c_short;
153
154        #[deprecated]
155        #[unsafe(method(deleteContents))]
156        #[unsafe(method_family = none)]
157        pub unsafe fn deleteContents(&self);
158
159        #[cfg(all(feature = "DOMDocumentFragment", feature = "DOMNode"))]
160        #[deprecated]
161        #[unsafe(method(extractContents))]
162        #[unsafe(method_family = none)]
163        pub unsafe fn extractContents(&self) -> Option<Retained<DOMDocumentFragment>>;
164
165        #[cfg(all(feature = "DOMDocumentFragment", feature = "DOMNode"))]
166        #[deprecated]
167        #[unsafe(method(cloneContents))]
168        #[unsafe(method_family = none)]
169        pub unsafe fn cloneContents(&self) -> Option<Retained<DOMDocumentFragment>>;
170
171        #[cfg(feature = "DOMNode")]
172        #[deprecated]
173        #[unsafe(method(insertNode:))]
174        #[unsafe(method_family = none)]
175        pub unsafe fn insertNode(&self, new_node: Option<&DOMNode>);
176
177        #[cfg(feature = "DOMNode")]
178        #[deprecated]
179        #[unsafe(method(surroundContents:))]
180        #[unsafe(method_family = none)]
181        pub unsafe fn surroundContents(&self, new_parent: Option<&DOMNode>);
182
183        #[deprecated]
184        #[unsafe(method(cloneRange))]
185        #[unsafe(method_family = none)]
186        pub unsafe fn cloneRange(&self) -> Option<Retained<DOMRange>>;
187
188        #[deprecated]
189        #[unsafe(method(toString))]
190        #[unsafe(method_family = none)]
191        pub unsafe fn toString(&self) -> Option<Retained<NSString>>;
192
193        #[deprecated]
194        #[unsafe(method(detach))]
195        #[unsafe(method_family = none)]
196        pub unsafe fn detach(&self);
197
198        #[cfg(all(feature = "DOMDocumentFragment", feature = "DOMNode"))]
199        #[unsafe(method(createContextualFragment:))]
200        #[unsafe(method_family = none)]
201        pub unsafe fn createContextualFragment(
202            &self,
203            html: Option<&NSString>,
204        ) -> Option<Retained<DOMDocumentFragment>>;
205
206        #[cfg(feature = "DOMNode")]
207        #[unsafe(method(compareNode:))]
208        #[unsafe(method_family = none)]
209        pub unsafe fn compareNode(&self, ref_node: Option<&DOMNode>) -> c_short;
210
211        #[cfg(feature = "DOMNode")]
212        #[unsafe(method(intersectsNode:))]
213        #[unsafe(method_family = none)]
214        pub unsafe fn intersectsNode(&self, ref_node: Option<&DOMNode>) -> bool;
215
216        #[cfg(feature = "DOMNode")]
217        #[unsafe(method(comparePoint:offset:))]
218        #[unsafe(method_family = none)]
219        pub unsafe fn comparePoint_offset(
220            &self,
221            ref_node: Option<&DOMNode>,
222            offset: c_int,
223        ) -> c_short;
224
225        #[cfg(feature = "DOMNode")]
226        #[unsafe(method(isPointInRange:offset:))]
227        #[unsafe(method_family = none)]
228        pub unsafe fn isPointInRange_offset(
229            &self,
230            ref_node: Option<&DOMNode>,
231            offset: c_int,
232        ) -> bool;
233    );
234}
235
236/// Methods declared on superclass `DOMObject`.
237#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
238impl DOMRange {
239    extern_methods!(
240        #[deprecated]
241        #[unsafe(method(init))]
242        #[unsafe(method_family = init)]
243        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
244    );
245}
246
247/// Methods declared on superclass `NSObject`.
248#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
249impl DOMRange {
250    extern_methods!(
251        #[unsafe(method(new))]
252        #[unsafe(method_family = new)]
253        pub unsafe fn new() -> Retained<Self>;
254    );
255}
256
257/// DOMRangeDeprecated.
258#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
259impl DOMRange {
260    extern_methods!(
261        #[cfg(feature = "DOMNode")]
262        #[deprecated]
263        #[unsafe(method(setStart::))]
264        #[unsafe(method_family = none)]
265        pub unsafe fn setStart(&self, ref_node: Option<&DOMNode>, offset: c_int);
266
267        #[cfg(feature = "DOMNode")]
268        #[deprecated]
269        #[unsafe(method(setEnd::))]
270        #[unsafe(method_family = none)]
271        pub unsafe fn setEnd(&self, ref_node: Option<&DOMNode>, offset: c_int);
272
273        #[deprecated]
274        #[unsafe(method(compareBoundaryPoints::))]
275        #[unsafe(method_family = none)]
276        pub unsafe fn compareBoundaryPoints(
277            &self,
278            how: c_ushort,
279            source_range: Option<&DOMRange>,
280        ) -> c_short;
281    );
282}