objc2_foundation/generated/
NSXMLNode.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct NSXMLNodeKind(pub NSUInteger);
14impl NSXMLNodeKind {
15 #[doc(alias = "NSXMLInvalidKind")]
16 pub const InvalidKind: Self = Self(0);
17 #[doc(alias = "NSXMLDocumentKind")]
18 pub const DocumentKind: Self = Self(1);
19 #[doc(alias = "NSXMLElementKind")]
20 pub const ElementKind: Self = Self(2);
21 #[doc(alias = "NSXMLAttributeKind")]
22 pub const AttributeKind: Self = Self(3);
23 #[doc(alias = "NSXMLNamespaceKind")]
24 pub const NamespaceKind: Self = Self(4);
25 #[doc(alias = "NSXMLProcessingInstructionKind")]
26 pub const ProcessingInstructionKind: Self = Self(5);
27 #[doc(alias = "NSXMLCommentKind")]
28 pub const CommentKind: Self = Self(6);
29 #[doc(alias = "NSXMLTextKind")]
30 pub const TextKind: Self = Self(7);
31 #[doc(alias = "NSXMLDTDKind")]
32 pub const DTDKind: Self = Self(8);
33 #[doc(alias = "NSXMLEntityDeclarationKind")]
34 pub const EntityDeclarationKind: Self = Self(9);
35 #[doc(alias = "NSXMLAttributeDeclarationKind")]
36 pub const AttributeDeclarationKind: Self = Self(10);
37 #[doc(alias = "NSXMLElementDeclarationKind")]
38 pub const ElementDeclarationKind: Self = Self(11);
39 #[doc(alias = "NSXMLNotationDeclarationKind")]
40 pub const NotationDeclarationKind: Self = Self(12);
41}
42
43unsafe impl Encode for NSXMLNodeKind {
44 const ENCODING: Encoding = NSUInteger::ENCODING;
45}
46
47unsafe impl RefEncode for NSXMLNodeKind {
48 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
49}
50
51extern_class!(
52 #[unsafe(super(NSObject))]
56 #[derive(Debug, PartialEq, Eq, Hash)]
57 pub struct NSXMLNode;
58);
59
60#[cfg(feature = "NSObject")]
61unsafe impl NSCopying for NSXMLNode {}
62
63#[cfg(feature = "NSObject")]
64unsafe impl CopyingHelper for NSXMLNode {
65 type Result = Self;
66}
67
68unsafe impl NSObjectProtocol for NSXMLNode {}
69
70impl NSXMLNode {
71 extern_methods!(
72 #[unsafe(method(init))]
73 #[unsafe(method_family = init)]
74 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
75
76 #[unsafe(method(initWithKind:))]
84 #[unsafe(method_family = init)]
85 pub unsafe fn initWithKind(this: Allocated<Self>, kind: NSXMLNodeKind) -> Retained<Self>;
86
87 #[cfg(feature = "NSXMLNodeOptions")]
88 #[unsafe(method(initWithKind:options:))]
90 #[unsafe(method_family = init)]
91 pub unsafe fn initWithKind_options(
92 this: Allocated<Self>,
93 kind: NSXMLNodeKind,
94 options: NSXMLNodeOptions,
95 ) -> Retained<Self>;
96
97 #[unsafe(method(document))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn document() -> Retained<AnyObject>;
101
102 #[cfg(feature = "NSXMLElement")]
103 #[unsafe(method(documentWithRootElement:))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn documentWithRootElement(element: &NSXMLElement) -> Retained<AnyObject>;
109
110 #[cfg(feature = "NSString")]
111 #[unsafe(method(elementWithName:))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn elementWithName(name: &NSString) -> Retained<AnyObject>;
122
123 #[cfg(feature = "NSString")]
124 #[unsafe(method(elementWithName:URI:))]
126 #[unsafe(method_family = none)]
127 pub unsafe fn elementWithName_URI(name: &NSString, uri: &NSString) -> Retained<AnyObject>;
128
129 #[cfg(feature = "NSString")]
130 #[unsafe(method(elementWithName:stringValue:))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn elementWithName_stringValue(
141 name: &NSString,
142 string: &NSString,
143 ) -> Retained<AnyObject>;
144
145 #[cfg(all(feature = "NSArray", feature = "NSString"))]
146 #[unsafe(method(elementWithName:children:attributes:))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn elementWithName_children_attributes(
159 name: &NSString,
160 children: Option<&NSArray<NSXMLNode>>,
161 attributes: Option<&NSArray<NSXMLNode>>,
162 ) -> Retained<AnyObject>;
163
164 #[cfg(feature = "NSString")]
165 #[unsafe(method(attributeWithName:stringValue:))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn attributeWithName_stringValue(
173 name: &NSString,
174 string_value: &NSString,
175 ) -> Retained<AnyObject>;
176
177 #[cfg(feature = "NSString")]
178 #[unsafe(method(attributeWithName:URI:stringValue:))]
180 #[unsafe(method_family = none)]
181 pub unsafe fn attributeWithName_URI_stringValue(
182 name: &NSString,
183 uri: &NSString,
184 string_value: &NSString,
185 ) -> Retained<AnyObject>;
186
187 #[cfg(feature = "NSString")]
188 #[unsafe(method(namespaceWithName:stringValue:))]
194 #[unsafe(method_family = none)]
195 pub unsafe fn namespaceWithName_stringValue(
196 name: &NSString,
197 string_value: &NSString,
198 ) -> Retained<AnyObject>;
199
200 #[cfg(feature = "NSString")]
201 #[unsafe(method(processingInstructionWithName:stringValue:))]
208 #[unsafe(method_family = none)]
209 pub unsafe fn processingInstructionWithName_stringValue(
210 name: &NSString,
211 string_value: &NSString,
212 ) -> Retained<AnyObject>;
213
214 #[cfg(feature = "NSString")]
215 #[unsafe(method(commentWithStringValue:))]
222 #[unsafe(method_family = none)]
223 pub unsafe fn commentWithStringValue(string_value: &NSString) -> Retained<AnyObject>;
224
225 #[cfg(feature = "NSString")]
226 #[unsafe(method(textWithStringValue:))]
228 #[unsafe(method_family = none)]
229 pub unsafe fn textWithStringValue(string_value: &NSString) -> Retained<AnyObject>;
230
231 #[cfg(feature = "NSString")]
232 #[unsafe(method(DTDNodeWithXMLString:))]
234 #[unsafe(method_family = none)]
235 pub unsafe fn DTDNodeWithXMLString(string: &NSString) -> Option<Retained<AnyObject>>;
236
237 #[unsafe(method(kind))]
239 #[unsafe(method_family = none)]
240 pub unsafe fn kind(&self) -> NSXMLNodeKind;
241
242 #[cfg(feature = "NSString")]
243 #[unsafe(method(name))]
245 #[unsafe(method_family = none)]
246 pub unsafe fn name(&self) -> Option<Retained<NSString>>;
247
248 #[cfg(feature = "NSString")]
249 #[unsafe(method(setName:))]
251 #[unsafe(method_family = none)]
252 pub unsafe fn setName(&self, name: Option<&NSString>);
253
254 #[unsafe(method(objectValue))]
256 #[unsafe(method_family = none)]
257 pub unsafe fn objectValue(&self) -> Option<Retained<AnyObject>>;
258
259 #[unsafe(method(setObjectValue:))]
261 #[unsafe(method_family = none)]
262 pub unsafe fn setObjectValue(&self, object_value: Option<&AnyObject>);
263
264 #[cfg(feature = "NSString")]
265 #[unsafe(method(stringValue))]
267 #[unsafe(method_family = none)]
268 pub unsafe fn stringValue(&self) -> Option<Retained<NSString>>;
269
270 #[cfg(feature = "NSString")]
271 #[unsafe(method(setStringValue:))]
273 #[unsafe(method_family = none)]
274 pub unsafe fn setStringValue(&self, string_value: Option<&NSString>);
275
276 #[cfg(feature = "NSString")]
277 #[unsafe(method(setStringValue:resolvingEntities:))]
285 #[unsafe(method_family = none)]
286 pub unsafe fn setStringValue_resolvingEntities(&self, string: &NSString, resolve: bool);
287
288 #[unsafe(method(index))]
290 #[unsafe(method_family = none)]
291 pub unsafe fn index(&self) -> NSUInteger;
292
293 #[unsafe(method(level))]
295 #[unsafe(method_family = none)]
296 pub unsafe fn level(&self) -> NSUInteger;
297
298 #[cfg(feature = "NSXMLDocument")]
299 #[unsafe(method(rootDocument))]
301 #[unsafe(method_family = none)]
302 pub unsafe fn rootDocument(&self) -> Option<Retained<NSXMLDocument>>;
303
304 #[unsafe(method(parent))]
306 #[unsafe(method_family = none)]
307 pub unsafe fn parent(&self) -> Option<Retained<NSXMLNode>>;
308
309 #[unsafe(method(childCount))]
311 #[unsafe(method_family = none)]
312 pub unsafe fn childCount(&self) -> NSUInteger;
313
314 #[cfg(feature = "NSArray")]
315 #[unsafe(method(children))]
317 #[unsafe(method_family = none)]
318 pub unsafe fn children(&self) -> Option<Retained<NSArray<NSXMLNode>>>;
319
320 #[unsafe(method(childAtIndex:))]
322 #[unsafe(method_family = none)]
323 pub unsafe fn childAtIndex(&self, index: NSUInteger) -> Option<Retained<NSXMLNode>>;
324
325 #[unsafe(method(previousSibling))]
327 #[unsafe(method_family = none)]
328 pub unsafe fn previousSibling(&self) -> Option<Retained<NSXMLNode>>;
329
330 #[unsafe(method(nextSibling))]
332 #[unsafe(method_family = none)]
333 pub unsafe fn nextSibling(&self) -> Option<Retained<NSXMLNode>>;
334
335 #[unsafe(method(previousNode))]
337 #[unsafe(method_family = none)]
338 pub unsafe fn previousNode(&self) -> Option<Retained<NSXMLNode>>;
339
340 #[unsafe(method(nextNode))]
342 #[unsafe(method_family = none)]
343 pub unsafe fn nextNode(&self) -> Option<Retained<NSXMLNode>>;
344
345 #[unsafe(method(detach))]
347 #[unsafe(method_family = none)]
348 pub unsafe fn detach(&self);
349
350 #[cfg(feature = "NSString")]
351 #[unsafe(method(XPath))]
353 #[unsafe(method_family = none)]
354 pub unsafe fn XPath(&self) -> Option<Retained<NSString>>;
355
356 #[cfg(feature = "NSString")]
357 #[unsafe(method(localName))]
359 #[unsafe(method_family = none)]
360 pub unsafe fn localName(&self) -> Option<Retained<NSString>>;
361
362 #[cfg(feature = "NSString")]
363 #[unsafe(method(prefix))]
365 #[unsafe(method_family = none)]
366 pub unsafe fn prefix(&self) -> Option<Retained<NSString>>;
367
368 #[cfg(feature = "NSString")]
369 #[unsafe(method(URI))]
371 #[unsafe(method_family = none)]
372 pub unsafe fn URI(&self) -> Option<Retained<NSString>>;
373
374 #[cfg(feature = "NSString")]
375 #[unsafe(method(setURI:))]
377 #[unsafe(method_family = none)]
378 pub unsafe fn setURI(&self, uri: Option<&NSString>);
379
380 #[cfg(feature = "NSString")]
381 #[unsafe(method(localNameForName:))]
383 #[unsafe(method_family = none)]
384 pub unsafe fn localNameForName(name: &NSString) -> Retained<NSString>;
385
386 #[cfg(feature = "NSString")]
387 #[unsafe(method(prefixForName:))]
389 #[unsafe(method_family = none)]
390 pub unsafe fn prefixForName(name: &NSString) -> Option<Retained<NSString>>;
391
392 #[cfg(feature = "NSString")]
393 #[unsafe(method(predefinedNamespaceForPrefix:))]
395 #[unsafe(method_family = none)]
396 pub unsafe fn predefinedNamespaceForPrefix(name: &NSString) -> Option<Retained<NSXMLNode>>;
397
398 #[cfg(feature = "NSString")]
399 #[unsafe(method(description))]
401 #[unsafe(method_family = none)]
402 pub unsafe fn description(&self) -> Retained<NSString>;
403
404 #[cfg(feature = "NSString")]
405 #[unsafe(method(XMLString))]
407 #[unsafe(method_family = none)]
408 pub unsafe fn XMLString(&self) -> Retained<NSString>;
409
410 #[cfg(all(feature = "NSString", feature = "NSXMLNodeOptions"))]
411 #[unsafe(method(XMLStringWithOptions:))]
413 #[unsafe(method_family = none)]
414 pub unsafe fn XMLStringWithOptions(&self, options: NSXMLNodeOptions) -> Retained<NSString>;
415
416 #[cfg(feature = "NSString")]
417 #[unsafe(method(canonicalXMLStringPreservingComments:))]
419 #[unsafe(method_family = none)]
420 pub unsafe fn canonicalXMLStringPreservingComments(
421 &self,
422 comments: bool,
423 ) -> Retained<NSString>;
424
425 #[cfg(all(feature = "NSArray", feature = "NSError", feature = "NSString"))]
426 #[unsafe(method(nodesForXPath:error:_))]
430 #[unsafe(method_family = none)]
431 pub unsafe fn nodesForXPath_error(
432 &self,
433 xpath: &NSString,
434 ) -> Result<Retained<NSArray<NSXMLNode>>, Retained<NSError>>;
435
436 #[cfg(all(
437 feature = "NSArray",
438 feature = "NSDictionary",
439 feature = "NSError",
440 feature = "NSString"
441 ))]
442 #[unsafe(method(objectsForXQuery:constants:error:_))]
446 #[unsafe(method_family = none)]
447 pub unsafe fn objectsForXQuery_constants_error(
448 &self,
449 xquery: &NSString,
450 constants: Option<&NSDictionary<NSString, AnyObject>>,
451 ) -> Result<Retained<NSArray>, Retained<NSError>>;
452
453 #[cfg(all(feature = "NSArray", feature = "NSError", feature = "NSString"))]
454 #[unsafe(method(objectsForXQuery:error:_))]
455 #[unsafe(method_family = none)]
456 pub unsafe fn objectsForXQuery_error(
457 &self,
458 xquery: &NSString,
459 ) -> Result<Retained<NSArray>, Retained<NSError>>;
460 );
461}
462
463impl NSXMLNode {
465 extern_methods!(
466 #[unsafe(method(new))]
467 #[unsafe(method_family = new)]
468 pub unsafe fn new() -> Retained<Self>;
469 );
470}