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:))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn setStart_offset(&self, ref_node: Option<&DOMNode>, offset: c_int);
103
104 #[cfg(feature = "DOMNode")]
105 #[unsafe(method(setEnd:offset:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn setEnd_offset(&self, ref_node: Option<&DOMNode>, offset: c_int);
108
109 #[cfg(feature = "DOMNode")]
110 #[deprecated]
111 #[unsafe(method(setStartBefore:))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn setStartBefore(&self, ref_node: Option<&DOMNode>);
114
115 #[cfg(feature = "DOMNode")]
116 #[deprecated]
117 #[unsafe(method(setStartAfter:))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn setStartAfter(&self, ref_node: Option<&DOMNode>);
120
121 #[cfg(feature = "DOMNode")]
122 #[deprecated]
123 #[unsafe(method(setEndBefore:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn setEndBefore(&self, ref_node: Option<&DOMNode>);
126
127 #[cfg(feature = "DOMNode")]
128 #[deprecated]
129 #[unsafe(method(setEndAfter:))]
130 #[unsafe(method_family = none)]
131 pub unsafe fn setEndAfter(&self, ref_node: Option<&DOMNode>);
132
133 #[deprecated]
134 #[unsafe(method(collapse:))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn collapse(&self, to_start: bool);
137
138 #[cfg(feature = "DOMNode")]
139 #[deprecated]
140 #[unsafe(method(selectNode:))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn selectNode(&self, ref_node: Option<&DOMNode>);
143
144 #[cfg(feature = "DOMNode")]
145 #[deprecated]
146 #[unsafe(method(selectNodeContents:))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn selectNodeContents(&self, ref_node: Option<&DOMNode>);
149
150 #[unsafe(method(compareBoundaryPoints:sourceRange:))]
151 #[unsafe(method_family = none)]
152 pub unsafe fn compareBoundaryPoints_sourceRange(
153 &self,
154 how: c_ushort,
155 source_range: Option<&DOMRange>,
156 ) -> c_short;
157
158 #[deprecated]
159 #[unsafe(method(deleteContents))]
160 #[unsafe(method_family = none)]
161 pub unsafe fn deleteContents(&self);
162
163 #[cfg(all(feature = "DOMDocumentFragment", feature = "DOMNode"))]
164 #[deprecated]
165 #[unsafe(method(extractContents))]
166 #[unsafe(method_family = none)]
167 pub unsafe fn extractContents(&self) -> Option<Retained<DOMDocumentFragment>>;
168
169 #[cfg(all(feature = "DOMDocumentFragment", feature = "DOMNode"))]
170 #[deprecated]
171 #[unsafe(method(cloneContents))]
172 #[unsafe(method_family = none)]
173 pub unsafe fn cloneContents(&self) -> Option<Retained<DOMDocumentFragment>>;
174
175 #[cfg(feature = "DOMNode")]
176 #[deprecated]
177 #[unsafe(method(insertNode:))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn insertNode(&self, new_node: Option<&DOMNode>);
180
181 #[cfg(feature = "DOMNode")]
182 #[deprecated]
183 #[unsafe(method(surroundContents:))]
184 #[unsafe(method_family = none)]
185 pub unsafe fn surroundContents(&self, new_parent: Option<&DOMNode>);
186
187 #[deprecated]
188 #[unsafe(method(cloneRange))]
189 #[unsafe(method_family = none)]
190 pub unsafe fn cloneRange(&self) -> Option<Retained<DOMRange>>;
191
192 #[deprecated]
193 #[unsafe(method(toString))]
194 #[unsafe(method_family = none)]
195 pub unsafe fn toString(&self) -> Option<Retained<NSString>>;
196
197 #[deprecated]
198 #[unsafe(method(detach))]
199 #[unsafe(method_family = none)]
200 pub unsafe fn detach(&self);
201
202 #[cfg(all(feature = "DOMDocumentFragment", feature = "DOMNode"))]
203 #[unsafe(method(createContextualFragment:))]
204 #[unsafe(method_family = none)]
205 pub unsafe fn createContextualFragment(
206 &self,
207 html: Option<&NSString>,
208 ) -> Option<Retained<DOMDocumentFragment>>;
209
210 #[cfg(feature = "DOMNode")]
211 #[unsafe(method(compareNode:))]
212 #[unsafe(method_family = none)]
213 pub unsafe fn compareNode(&self, ref_node: Option<&DOMNode>) -> c_short;
214
215 #[cfg(feature = "DOMNode")]
216 #[unsafe(method(intersectsNode:))]
217 #[unsafe(method_family = none)]
218 pub unsafe fn intersectsNode(&self, ref_node: Option<&DOMNode>) -> bool;
219
220 #[cfg(feature = "DOMNode")]
221 #[unsafe(method(comparePoint:offset:))]
222 #[unsafe(method_family = none)]
223 pub unsafe fn comparePoint_offset(
224 &self,
225 ref_node: Option<&DOMNode>,
226 offset: c_int,
227 ) -> c_short;
228
229 #[cfg(feature = "DOMNode")]
230 #[unsafe(method(isPointInRange:offset:))]
231 #[unsafe(method_family = none)]
232 pub unsafe fn isPointInRange_offset(
233 &self,
234 ref_node: Option<&DOMNode>,
235 offset: c_int,
236 ) -> bool;
237 );
238}
239
240#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
242impl DOMRange {
243 extern_methods!(
244 #[deprecated]
245 #[unsafe(method(init))]
246 #[unsafe(method_family = init)]
247 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
248 );
249}
250
251#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
253impl DOMRange {
254 extern_methods!(
255 #[unsafe(method(new))]
256 #[unsafe(method_family = new)]
257 pub unsafe fn new() -> Retained<Self>;
258 );
259}
260
261#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
263impl DOMRange {
264 extern_methods!(
265 #[cfg(feature = "DOMNode")]
266 #[deprecated]
267 #[unsafe(method(setStart::))]
268 #[unsafe(method_family = none)]
269 pub unsafe fn setStart(&self, ref_node: Option<&DOMNode>, offset: c_int);
270
271 #[cfg(feature = "DOMNode")]
272 #[deprecated]
273 #[unsafe(method(setEnd::))]
274 #[unsafe(method_family = none)]
275 pub unsafe fn setEnd(&self, ref_node: Option<&DOMNode>, offset: c_int);
276
277 #[deprecated]
278 #[unsafe(method(compareBoundaryPoints::))]
279 #[unsafe(method_family = none)]
280 pub unsafe fn compareBoundaryPoints(
281 &self,
282 how: c_ushort,
283 source_range: Option<&DOMRange>,
284 ) -> c_short;
285 );
286}