objc2_web_kit/generated/
DOMRange.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[deprecated]
12pub const DOM_START_TO_START: c_uint = 0;
13#[deprecated]
15pub const DOM_START_TO_END: c_uint = 1;
16#[deprecated]
18pub const DOM_END_TO_END: c_uint = 2;
19#[deprecated]
21pub const DOM_END_TO_START: c_uint = 3;
22#[deprecated]
24pub const DOM_NODE_BEFORE: c_uint = 0;
25#[deprecated]
27pub const DOM_NODE_AFTER: c_uint = 1;
28#[deprecated]
30pub const DOM_NODE_BEFORE_AND_AFTER: c_uint = 2;
31#[deprecated]
33pub const DOM_NODE_INSIDE: c_uint = 3;
34
35extern_class!(
36 #[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"))]
45extern_conformance!(
46 unsafe impl NSCopying for DOMRange {}
47);
48
49#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
50unsafe impl CopyingHelper for DOMRange {
51 type Result = Self;
52}
53
54#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
55extern_conformance!(
56 unsafe impl NSObjectProtocol for DOMRange {}
57);
58
59#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
60impl DOMRange {
61 extern_methods!(
62 #[cfg(feature = "DOMNode")]
63 #[deprecated]
64 #[unsafe(method(startContainer))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn startContainer(&self) -> Option<Retained<DOMNode>>;
67
68 #[deprecated]
69 #[unsafe(method(startOffset))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn startOffset(&self) -> c_int;
72
73 #[cfg(feature = "DOMNode")]
74 #[deprecated]
75 #[unsafe(method(endContainer))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn endContainer(&self) -> Option<Retained<DOMNode>>;
78
79 #[deprecated]
80 #[unsafe(method(endOffset))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn endOffset(&self) -> c_int;
83
84 #[deprecated]
85 #[unsafe(method(collapsed))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn collapsed(&self) -> bool;
88
89 #[cfg(feature = "DOMNode")]
90 #[deprecated]
91 #[unsafe(method(commonAncestorContainer))]
92 #[unsafe(method_family = none)]
93 pub unsafe fn commonAncestorContainer(&self) -> Option<Retained<DOMNode>>;
94
95 #[unsafe(method(text))]
96 #[unsafe(method_family = none)]
97 pub unsafe fn text(&self) -> Retained<NSString>;
98
99 #[cfg(feature = "DOMNode")]
100 #[unsafe(method(setStart:offset:))]
104 #[unsafe(method_family = none)]
105 pub unsafe fn setStart_offset(&self, ref_node: Option<&DOMNode>, offset: c_int);
106
107 #[cfg(feature = "DOMNode")]
108 #[unsafe(method(setEnd:offset:))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn setEnd_offset(&self, ref_node: Option<&DOMNode>, offset: c_int);
114
115 #[cfg(feature = "DOMNode")]
116 #[deprecated]
120 #[unsafe(method(setStartBefore:))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn setStartBefore(&self, ref_node: Option<&DOMNode>);
123
124 #[cfg(feature = "DOMNode")]
125 #[deprecated]
129 #[unsafe(method(setStartAfter:))]
130 #[unsafe(method_family = none)]
131 pub unsafe fn setStartAfter(&self, ref_node: Option<&DOMNode>);
132
133 #[cfg(feature = "DOMNode")]
134 #[deprecated]
138 #[unsafe(method(setEndBefore:))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn setEndBefore(&self, ref_node: Option<&DOMNode>);
141
142 #[cfg(feature = "DOMNode")]
143 #[deprecated]
147 #[unsafe(method(setEndAfter:))]
148 #[unsafe(method_family = none)]
149 pub unsafe fn setEndAfter(&self, ref_node: Option<&DOMNode>);
150
151 #[deprecated]
152 #[unsafe(method(collapse:))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn collapse(&self, to_start: bool);
155
156 #[cfg(feature = "DOMNode")]
157 #[deprecated]
161 #[unsafe(method(selectNode:))]
162 #[unsafe(method_family = none)]
163 pub unsafe fn selectNode(&self, ref_node: Option<&DOMNode>);
164
165 #[cfg(feature = "DOMNode")]
166 #[deprecated]
170 #[unsafe(method(selectNodeContents:))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn selectNodeContents(&self, ref_node: Option<&DOMNode>);
173
174 #[unsafe(method(compareBoundaryPoints:sourceRange:))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn compareBoundaryPoints_sourceRange(
180 &self,
181 how: c_ushort,
182 source_range: Option<&DOMRange>,
183 ) -> c_short;
184
185 #[deprecated]
186 #[unsafe(method(deleteContents))]
187 #[unsafe(method_family = none)]
188 pub unsafe fn deleteContents(&self);
189
190 #[cfg(all(feature = "DOMDocumentFragment", feature = "DOMNode"))]
191 #[deprecated]
192 #[unsafe(method(extractContents))]
193 #[unsafe(method_family = none)]
194 pub unsafe fn extractContents(&self) -> Option<Retained<DOMDocumentFragment>>;
195
196 #[cfg(all(feature = "DOMDocumentFragment", feature = "DOMNode"))]
197 #[deprecated]
198 #[unsafe(method(cloneContents))]
199 #[unsafe(method_family = none)]
200 pub unsafe fn cloneContents(&self) -> Option<Retained<DOMDocumentFragment>>;
201
202 #[cfg(feature = "DOMNode")]
203 #[deprecated]
207 #[unsafe(method(insertNode:))]
208 #[unsafe(method_family = none)]
209 pub unsafe fn insertNode(&self, new_node: Option<&DOMNode>);
210
211 #[cfg(feature = "DOMNode")]
212 #[deprecated]
216 #[unsafe(method(surroundContents:))]
217 #[unsafe(method_family = none)]
218 pub unsafe fn surroundContents(&self, new_parent: Option<&DOMNode>);
219
220 #[deprecated]
221 #[unsafe(method(cloneRange))]
222 #[unsafe(method_family = none)]
223 pub unsafe fn cloneRange(&self) -> Option<Retained<DOMRange>>;
224
225 #[deprecated]
226 #[unsafe(method(toString))]
227 #[unsafe(method_family = none)]
228 pub unsafe fn toString(&self) -> Option<Retained<NSString>>;
229
230 #[deprecated]
231 #[unsafe(method(detach))]
232 #[unsafe(method_family = none)]
233 pub unsafe fn detach(&self);
234
235 #[cfg(all(feature = "DOMDocumentFragment", feature = "DOMNode"))]
236 #[unsafe(method(createContextualFragment:))]
240 #[unsafe(method_family = none)]
241 pub unsafe fn createContextualFragment(
242 &self,
243 html: Option<&NSString>,
244 ) -> Option<Retained<DOMDocumentFragment>>;
245
246 #[cfg(feature = "DOMNode")]
247 #[unsafe(method(compareNode:))]
251 #[unsafe(method_family = none)]
252 pub unsafe fn compareNode(&self, ref_node: Option<&DOMNode>) -> c_short;
253
254 #[cfg(feature = "DOMNode")]
255 #[unsafe(method(intersectsNode:))]
259 #[unsafe(method_family = none)]
260 pub unsafe fn intersectsNode(&self, ref_node: Option<&DOMNode>) -> bool;
261
262 #[cfg(feature = "DOMNode")]
263 #[unsafe(method(comparePoint:offset:))]
267 #[unsafe(method_family = none)]
268 pub unsafe fn comparePoint_offset(
269 &self,
270 ref_node: Option<&DOMNode>,
271 offset: c_int,
272 ) -> c_short;
273
274 #[cfg(feature = "DOMNode")]
275 #[unsafe(method(isPointInRange:offset:))]
279 #[unsafe(method_family = none)]
280 pub unsafe fn isPointInRange_offset(
281 &self,
282 ref_node: Option<&DOMNode>,
283 offset: c_int,
284 ) -> bool;
285 );
286}
287
288#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
290impl DOMRange {
291 extern_methods!(
292 #[deprecated]
293 #[unsafe(method(init))]
294 #[unsafe(method_family = init)]
295 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
296 );
297}
298
299#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
301impl DOMRange {
302 extern_methods!(
303 #[unsafe(method(new))]
304 #[unsafe(method_family = new)]
305 pub unsafe fn new() -> Retained<Self>;
306 );
307}
308
309#[deprecated]
311#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
312impl DOMRange {
313 extern_methods!(
314 #[cfg(feature = "DOMNode")]
315 #[deprecated]
319 #[unsafe(method(setStart::))]
320 #[unsafe(method_family = none)]
321 pub unsafe fn setStart(&self, ref_node: Option<&DOMNode>, offset: c_int);
322
323 #[cfg(feature = "DOMNode")]
324 #[deprecated]
328 #[unsafe(method(setEnd::))]
329 #[unsafe(method_family = none)]
330 pub unsafe fn setEnd(&self, ref_node: Option<&DOMNode>, offset: c_int);
331
332 #[deprecated]
336 #[unsafe(method(compareBoundaryPoints::))]
337 #[unsafe(method_family = none)]
338 pub unsafe fn compareBoundaryPoints(
339 &self,
340 how: c_ushort,
341 source_range: Option<&DOMRange>,
342 ) -> c_short;
343 );
344}