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")]
61extern_conformance!(
62 unsafe impl NSCopying for NSXMLNode {}
63);
64
65#[cfg(feature = "NSObject")]
66unsafe impl CopyingHelper for NSXMLNode {
67 type Result = Self;
68}
69
70extern_conformance!(
71 unsafe impl NSObjectProtocol for NSXMLNode {}
72);
73
74impl NSXMLNode {
75 extern_methods!(
76 #[unsafe(method(init))]
77 #[unsafe(method_family = init)]
78 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
79
80 #[unsafe(method(initWithKind:))]
88 #[unsafe(method_family = init)]
89 pub unsafe fn initWithKind(this: Allocated<Self>, kind: NSXMLNodeKind) -> Retained<Self>;
90
91 #[cfg(feature = "NSXMLNodeOptions")]
92 #[unsafe(method(initWithKind:options:))]
94 #[unsafe(method_family = init)]
95 pub unsafe fn initWithKind_options(
96 this: Allocated<Self>,
97 kind: NSXMLNodeKind,
98 options: NSXMLNodeOptions,
99 ) -> Retained<Self>;
100
101 #[unsafe(method(document))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn document() -> Retained<AnyObject>;
105
106 #[cfg(feature = "NSXMLElement")]
107 #[unsafe(method(documentWithRootElement:))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn documentWithRootElement(element: &NSXMLElement) -> Retained<AnyObject>;
113
114 #[cfg(feature = "NSString")]
115 #[unsafe(method(elementWithName:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn elementWithName(name: &NSString) -> Retained<AnyObject>;
126
127 #[cfg(feature = "NSString")]
128 #[unsafe(method(elementWithName:URI:))]
130 #[unsafe(method_family = none)]
131 pub unsafe fn elementWithName_URI(name: &NSString, uri: &NSString) -> Retained<AnyObject>;
132
133 #[cfg(feature = "NSString")]
134 #[unsafe(method(elementWithName:stringValue:))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn elementWithName_stringValue(
145 name: &NSString,
146 string: &NSString,
147 ) -> Retained<AnyObject>;
148
149 #[cfg(all(feature = "NSArray", feature = "NSString"))]
150 #[unsafe(method(elementWithName:children:attributes:))]
161 #[unsafe(method_family = none)]
162 pub unsafe fn elementWithName_children_attributes(
163 name: &NSString,
164 children: Option<&NSArray<NSXMLNode>>,
165 attributes: Option<&NSArray<NSXMLNode>>,
166 ) -> Retained<AnyObject>;
167
168 #[cfg(feature = "NSString")]
169 #[unsafe(method(attributeWithName:stringValue:))]
175 #[unsafe(method_family = none)]
176 pub unsafe fn attributeWithName_stringValue(
177 name: &NSString,
178 string_value: &NSString,
179 ) -> Retained<AnyObject>;
180
181 #[cfg(feature = "NSString")]
182 #[unsafe(method(attributeWithName:URI:stringValue:))]
184 #[unsafe(method_family = none)]
185 pub unsafe fn attributeWithName_URI_stringValue(
186 name: &NSString,
187 uri: &NSString,
188 string_value: &NSString,
189 ) -> Retained<AnyObject>;
190
191 #[cfg(feature = "NSString")]
192 #[unsafe(method(namespaceWithName:stringValue:))]
198 #[unsafe(method_family = none)]
199 pub unsafe fn namespaceWithName_stringValue(
200 name: &NSString,
201 string_value: &NSString,
202 ) -> Retained<AnyObject>;
203
204 #[cfg(feature = "NSString")]
205 #[unsafe(method(processingInstructionWithName:stringValue:))]
212 #[unsafe(method_family = none)]
213 pub unsafe fn processingInstructionWithName_stringValue(
214 name: &NSString,
215 string_value: &NSString,
216 ) -> Retained<AnyObject>;
217
218 #[cfg(feature = "NSString")]
219 #[unsafe(method(commentWithStringValue:))]
226 #[unsafe(method_family = none)]
227 pub unsafe fn commentWithStringValue(string_value: &NSString) -> Retained<AnyObject>;
228
229 #[cfg(feature = "NSString")]
230 #[unsafe(method(textWithStringValue:))]
232 #[unsafe(method_family = none)]
233 pub unsafe fn textWithStringValue(string_value: &NSString) -> Retained<AnyObject>;
234
235 #[cfg(feature = "NSString")]
236 #[unsafe(method(DTDNodeWithXMLString:))]
238 #[unsafe(method_family = none)]
239 pub unsafe fn DTDNodeWithXMLString(string: &NSString) -> Option<Retained<AnyObject>>;
240
241 #[unsafe(method(kind))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn kind(&self) -> NSXMLNodeKind;
245
246 #[cfg(feature = "NSString")]
247 #[unsafe(method(name))]
249 #[unsafe(method_family = none)]
250 pub unsafe fn name(&self) -> Option<Retained<NSString>>;
251
252 #[cfg(feature = "NSString")]
253 #[unsafe(method(setName:))]
255 #[unsafe(method_family = none)]
256 pub unsafe fn setName(&self, name: Option<&NSString>);
257
258 #[unsafe(method(objectValue))]
260 #[unsafe(method_family = none)]
261 pub unsafe fn objectValue(&self) -> Option<Retained<AnyObject>>;
262
263 #[unsafe(method(setObjectValue:))]
265 #[unsafe(method_family = none)]
266 pub unsafe fn setObjectValue(&self, object_value: Option<&AnyObject>);
267
268 #[cfg(feature = "NSString")]
269 #[unsafe(method(stringValue))]
271 #[unsafe(method_family = none)]
272 pub unsafe fn stringValue(&self) -> Option<Retained<NSString>>;
273
274 #[cfg(feature = "NSString")]
275 #[unsafe(method(setStringValue:))]
277 #[unsafe(method_family = none)]
278 pub unsafe fn setStringValue(&self, string_value: Option<&NSString>);
279
280 #[cfg(feature = "NSString")]
281 #[unsafe(method(setStringValue:resolvingEntities:))]
289 #[unsafe(method_family = none)]
290 pub unsafe fn setStringValue_resolvingEntities(&self, string: &NSString, resolve: bool);
291
292 #[unsafe(method(index))]
294 #[unsafe(method_family = none)]
295 pub unsafe fn index(&self) -> NSUInteger;
296
297 #[unsafe(method(level))]
299 #[unsafe(method_family = none)]
300 pub unsafe fn level(&self) -> NSUInteger;
301
302 #[cfg(feature = "NSXMLDocument")]
303 #[unsafe(method(rootDocument))]
305 #[unsafe(method_family = none)]
306 pub unsafe fn rootDocument(&self) -> Option<Retained<NSXMLDocument>>;
307
308 #[unsafe(method(parent))]
310 #[unsafe(method_family = none)]
311 pub unsafe fn parent(&self) -> Option<Retained<NSXMLNode>>;
312
313 #[unsafe(method(childCount))]
315 #[unsafe(method_family = none)]
316 pub unsafe fn childCount(&self) -> NSUInteger;
317
318 #[cfg(feature = "NSArray")]
319 #[unsafe(method(children))]
321 #[unsafe(method_family = none)]
322 pub unsafe fn children(&self) -> Option<Retained<NSArray<NSXMLNode>>>;
323
324 #[unsafe(method(childAtIndex:))]
326 #[unsafe(method_family = none)]
327 pub unsafe fn childAtIndex(&self, index: NSUInteger) -> Option<Retained<NSXMLNode>>;
328
329 #[unsafe(method(previousSibling))]
331 #[unsafe(method_family = none)]
332 pub unsafe fn previousSibling(&self) -> Option<Retained<NSXMLNode>>;
333
334 #[unsafe(method(nextSibling))]
336 #[unsafe(method_family = none)]
337 pub unsafe fn nextSibling(&self) -> Option<Retained<NSXMLNode>>;
338
339 #[unsafe(method(previousNode))]
341 #[unsafe(method_family = none)]
342 pub unsafe fn previousNode(&self) -> Option<Retained<NSXMLNode>>;
343
344 #[unsafe(method(nextNode))]
346 #[unsafe(method_family = none)]
347 pub unsafe fn nextNode(&self) -> Option<Retained<NSXMLNode>>;
348
349 #[unsafe(method(detach))]
351 #[unsafe(method_family = none)]
352 pub unsafe fn detach(&self);
353
354 #[cfg(feature = "NSString")]
355 #[unsafe(method(XPath))]
357 #[unsafe(method_family = none)]
358 pub unsafe fn XPath(&self) -> Option<Retained<NSString>>;
359
360 #[cfg(feature = "NSString")]
361 #[unsafe(method(localName))]
363 #[unsafe(method_family = none)]
364 pub unsafe fn localName(&self) -> Option<Retained<NSString>>;
365
366 #[cfg(feature = "NSString")]
367 #[unsafe(method(prefix))]
369 #[unsafe(method_family = none)]
370 pub unsafe fn prefix(&self) -> Option<Retained<NSString>>;
371
372 #[cfg(feature = "NSString")]
373 #[unsafe(method(URI))]
375 #[unsafe(method_family = none)]
376 pub unsafe fn URI(&self) -> Option<Retained<NSString>>;
377
378 #[cfg(feature = "NSString")]
379 #[unsafe(method(setURI:))]
381 #[unsafe(method_family = none)]
382 pub unsafe fn setURI(&self, uri: Option<&NSString>);
383
384 #[cfg(feature = "NSString")]
385 #[unsafe(method(localNameForName:))]
387 #[unsafe(method_family = none)]
388 pub unsafe fn localNameForName(name: &NSString) -> Retained<NSString>;
389
390 #[cfg(feature = "NSString")]
391 #[unsafe(method(prefixForName:))]
393 #[unsafe(method_family = none)]
394 pub unsafe fn prefixForName(name: &NSString) -> Option<Retained<NSString>>;
395
396 #[cfg(feature = "NSString")]
397 #[unsafe(method(predefinedNamespaceForPrefix:))]
399 #[unsafe(method_family = none)]
400 pub unsafe fn predefinedNamespaceForPrefix(name: &NSString) -> Option<Retained<NSXMLNode>>;
401
402 #[cfg(feature = "NSString")]
403 #[unsafe(method(description))]
405 #[unsafe(method_family = none)]
406 pub unsafe fn description(&self) -> Retained<NSString>;
407
408 #[cfg(feature = "NSString")]
409 #[unsafe(method(XMLString))]
411 #[unsafe(method_family = none)]
412 pub unsafe fn XMLString(&self) -> Retained<NSString>;
413
414 #[cfg(all(feature = "NSString", feature = "NSXMLNodeOptions"))]
415 #[unsafe(method(XMLStringWithOptions:))]
417 #[unsafe(method_family = none)]
418 pub unsafe fn XMLStringWithOptions(&self, options: NSXMLNodeOptions) -> Retained<NSString>;
419
420 #[cfg(feature = "NSString")]
421 #[unsafe(method(canonicalXMLStringPreservingComments:))]
423 #[unsafe(method_family = none)]
424 pub unsafe fn canonicalXMLStringPreservingComments(
425 &self,
426 comments: bool,
427 ) -> Retained<NSString>;
428
429 #[cfg(all(feature = "NSArray", feature = "NSError", feature = "NSString"))]
430 #[unsafe(method(nodesForXPath:error:_))]
434 #[unsafe(method_family = none)]
435 pub unsafe fn nodesForXPath_error(
436 &self,
437 xpath: &NSString,
438 ) -> Result<Retained<NSArray<NSXMLNode>>, Retained<NSError>>;
439
440 #[cfg(all(
441 feature = "NSArray",
442 feature = "NSDictionary",
443 feature = "NSError",
444 feature = "NSString"
445 ))]
446 #[unsafe(method(objectsForXQuery:constants:error:_))]
450 #[unsafe(method_family = none)]
451 pub unsafe fn objectsForXQuery_constants_error(
452 &self,
453 xquery: &NSString,
454 constants: Option<&NSDictionary<NSString, AnyObject>>,
455 ) -> Result<Retained<NSArray>, Retained<NSError>>;
456
457 #[cfg(all(feature = "NSArray", feature = "NSError", feature = "NSString"))]
458 #[unsafe(method(objectsForXQuery:error:_))]
459 #[unsafe(method_family = none)]
460 pub unsafe fn objectsForXQuery_error(
461 &self,
462 xquery: &NSString,
463 ) -> Result<Retained<NSArray>, Retained<NSError>>;
464 );
465}
466
467impl NSXMLNode {
469 extern_methods!(
470 #[unsafe(method(new))]
471 #[unsafe(method_family = new)]
472 pub unsafe fn new() -> Retained<Self>;
473 );
474}