use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSXMLNodeKind(pub NSUInteger);
impl NSXMLNodeKind {
#[doc(alias = "NSXMLInvalidKind")]
pub const InvalidKind: Self = Self(0);
#[doc(alias = "NSXMLDocumentKind")]
pub const DocumentKind: Self = Self(1);
#[doc(alias = "NSXMLElementKind")]
pub const ElementKind: Self = Self(2);
#[doc(alias = "NSXMLAttributeKind")]
pub const AttributeKind: Self = Self(3);
#[doc(alias = "NSXMLNamespaceKind")]
pub const NamespaceKind: Self = Self(4);
#[doc(alias = "NSXMLProcessingInstructionKind")]
pub const ProcessingInstructionKind: Self = Self(5);
#[doc(alias = "NSXMLCommentKind")]
pub const CommentKind: Self = Self(6);
#[doc(alias = "NSXMLTextKind")]
pub const TextKind: Self = Self(7);
#[doc(alias = "NSXMLDTDKind")]
pub const DTDKind: Self = Self(8);
#[doc(alias = "NSXMLEntityDeclarationKind")]
pub const EntityDeclarationKind: Self = Self(9);
#[doc(alias = "NSXMLAttributeDeclarationKind")]
pub const AttributeDeclarationKind: Self = Self(10);
#[doc(alias = "NSXMLElementDeclarationKind")]
pub const ElementDeclarationKind: Self = Self(11);
#[doc(alias = "NSXMLNotationDeclarationKind")]
pub const NotationDeclarationKind: Self = Self(12);
}
unsafe impl Encode for NSXMLNodeKind {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSXMLNodeKind {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSXMLNode;
);
#[cfg(feature = "NSObject")]
extern_conformance!(
unsafe impl NSCopying for NSXMLNode {}
);
#[cfg(feature = "NSObject")]
unsafe impl CopyingHelper for NSXMLNode {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSXMLNode {}
);
impl NSXMLNode {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(initWithKind:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithKind(this: Allocated<Self>, kind: NSXMLNodeKind) -> Retained<Self>;
#[cfg(feature = "NSXMLNodeOptions")]
#[unsafe(method(initWithKind:options:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithKind_options(
this: Allocated<Self>,
kind: NSXMLNodeKind,
options: NSXMLNodeOptions,
) -> Retained<Self>;
#[unsafe(method(document))]
#[unsafe(method_family = none)]
pub unsafe fn document() -> Retained<AnyObject>;
#[cfg(feature = "NSXMLElement")]
#[unsafe(method(documentWithRootElement:))]
#[unsafe(method_family = none)]
pub unsafe fn documentWithRootElement(element: &NSXMLElement) -> Retained<AnyObject>;
#[cfg(feature = "NSString")]
#[unsafe(method(elementWithName:))]
#[unsafe(method_family = none)]
pub unsafe fn elementWithName(name: &NSString) -> Retained<AnyObject>;
#[cfg(feature = "NSString")]
#[unsafe(method(elementWithName:URI:))]
#[unsafe(method_family = none)]
pub unsafe fn elementWithName_URI(name: &NSString, uri: &NSString) -> Retained<AnyObject>;
#[cfg(feature = "NSString")]
#[unsafe(method(elementWithName:stringValue:))]
#[unsafe(method_family = none)]
pub unsafe fn elementWithName_stringValue(
name: &NSString,
string: &NSString,
) -> Retained<AnyObject>;
#[cfg(all(feature = "NSArray", feature = "NSString"))]
#[unsafe(method(elementWithName:children:attributes:))]
#[unsafe(method_family = none)]
pub unsafe fn elementWithName_children_attributes(
name: &NSString,
children: Option<&NSArray<NSXMLNode>>,
attributes: Option<&NSArray<NSXMLNode>>,
) -> Retained<AnyObject>;
#[cfg(feature = "NSString")]
#[unsafe(method(attributeWithName:stringValue:))]
#[unsafe(method_family = none)]
pub unsafe fn attributeWithName_stringValue(
name: &NSString,
string_value: &NSString,
) -> Retained<AnyObject>;
#[cfg(feature = "NSString")]
#[unsafe(method(attributeWithName:URI:stringValue:))]
#[unsafe(method_family = none)]
pub unsafe fn attributeWithName_URI_stringValue(
name: &NSString,
uri: &NSString,
string_value: &NSString,
) -> Retained<AnyObject>;
#[cfg(feature = "NSString")]
#[unsafe(method(namespaceWithName:stringValue:))]
#[unsafe(method_family = none)]
pub unsafe fn namespaceWithName_stringValue(
name: &NSString,
string_value: &NSString,
) -> Retained<AnyObject>;
#[cfg(feature = "NSString")]
#[unsafe(method(processingInstructionWithName:stringValue:))]
#[unsafe(method_family = none)]
pub unsafe fn processingInstructionWithName_stringValue(
name: &NSString,
string_value: &NSString,
) -> Retained<AnyObject>;
#[cfg(feature = "NSString")]
#[unsafe(method(commentWithStringValue:))]
#[unsafe(method_family = none)]
pub unsafe fn commentWithStringValue(string_value: &NSString) -> Retained<AnyObject>;
#[cfg(feature = "NSString")]
#[unsafe(method(textWithStringValue:))]
#[unsafe(method_family = none)]
pub unsafe fn textWithStringValue(string_value: &NSString) -> Retained<AnyObject>;
#[cfg(feature = "NSString")]
#[unsafe(method(DTDNodeWithXMLString:))]
#[unsafe(method_family = none)]
pub unsafe fn DTDNodeWithXMLString(string: &NSString) -> Option<Retained<AnyObject>>;
#[unsafe(method(kind))]
#[unsafe(method_family = none)]
pub unsafe fn kind(&self) -> NSXMLNodeKind;
#[cfg(feature = "NSString")]
#[unsafe(method(name))]
#[unsafe(method_family = none)]
pub unsafe fn name(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "NSString")]
#[unsafe(method(setName:))]
#[unsafe(method_family = none)]
pub unsafe fn setName(&self, name: Option<&NSString>);
#[unsafe(method(objectValue))]
#[unsafe(method_family = none)]
pub unsafe fn objectValue(&self) -> Option<Retained<AnyObject>>;
#[unsafe(method(setObjectValue:))]
#[unsafe(method_family = none)]
pub unsafe fn setObjectValue(&self, object_value: Option<&AnyObject>);
#[cfg(feature = "NSString")]
#[unsafe(method(stringValue))]
#[unsafe(method_family = none)]
pub unsafe fn stringValue(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "NSString")]
#[unsafe(method(setStringValue:))]
#[unsafe(method_family = none)]
pub unsafe fn setStringValue(&self, string_value: Option<&NSString>);
#[cfg(feature = "NSString")]
#[unsafe(method(setStringValue:resolvingEntities:))]
#[unsafe(method_family = none)]
pub unsafe fn setStringValue_resolvingEntities(&self, string: &NSString, resolve: bool);
#[unsafe(method(index))]
#[unsafe(method_family = none)]
pub unsafe fn index(&self) -> NSUInteger;
#[unsafe(method(level))]
#[unsafe(method_family = none)]
pub unsafe fn level(&self) -> NSUInteger;
#[cfg(feature = "NSXMLDocument")]
#[unsafe(method(rootDocument))]
#[unsafe(method_family = none)]
pub unsafe fn rootDocument(&self) -> Option<Retained<NSXMLDocument>>;
#[unsafe(method(parent))]
#[unsafe(method_family = none)]
pub unsafe fn parent(&self) -> Option<Retained<NSXMLNode>>;
#[unsafe(method(childCount))]
#[unsafe(method_family = none)]
pub unsafe fn childCount(&self) -> NSUInteger;
#[cfg(feature = "NSArray")]
#[unsafe(method(children))]
#[unsafe(method_family = none)]
pub unsafe fn children(&self) -> Option<Retained<NSArray<NSXMLNode>>>;
#[unsafe(method(childAtIndex:))]
#[unsafe(method_family = none)]
pub unsafe fn childAtIndex(&self, index: NSUInteger) -> Option<Retained<NSXMLNode>>;
#[unsafe(method(previousSibling))]
#[unsafe(method_family = none)]
pub unsafe fn previousSibling(&self) -> Option<Retained<NSXMLNode>>;
#[unsafe(method(nextSibling))]
#[unsafe(method_family = none)]
pub unsafe fn nextSibling(&self) -> Option<Retained<NSXMLNode>>;
#[unsafe(method(previousNode))]
#[unsafe(method_family = none)]
pub unsafe fn previousNode(&self) -> Option<Retained<NSXMLNode>>;
#[unsafe(method(nextNode))]
#[unsafe(method_family = none)]
pub unsafe fn nextNode(&self) -> Option<Retained<NSXMLNode>>;
#[unsafe(method(detach))]
#[unsafe(method_family = none)]
pub unsafe fn detach(&self);
#[cfg(feature = "NSString")]
#[unsafe(method(XPath))]
#[unsafe(method_family = none)]
pub unsafe fn XPath(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "NSString")]
#[unsafe(method(localName))]
#[unsafe(method_family = none)]
pub unsafe fn localName(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "NSString")]
#[unsafe(method(prefix))]
#[unsafe(method_family = none)]
pub unsafe fn prefix(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "NSString")]
#[unsafe(method(URI))]
#[unsafe(method_family = none)]
pub unsafe fn URI(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "NSString")]
#[unsafe(method(setURI:))]
#[unsafe(method_family = none)]
pub unsafe fn setURI(&self, uri: Option<&NSString>);
#[cfg(feature = "NSString")]
#[unsafe(method(localNameForName:))]
#[unsafe(method_family = none)]
pub unsafe fn localNameForName(name: &NSString) -> Retained<NSString>;
#[cfg(feature = "NSString")]
#[unsafe(method(prefixForName:))]
#[unsafe(method_family = none)]
pub unsafe fn prefixForName(name: &NSString) -> Option<Retained<NSString>>;
#[cfg(feature = "NSString")]
#[unsafe(method(predefinedNamespaceForPrefix:))]
#[unsafe(method_family = none)]
pub unsafe fn predefinedNamespaceForPrefix(name: &NSString) -> Option<Retained<NSXMLNode>>;
#[cfg(feature = "NSString")]
#[unsafe(method(description))]
#[unsafe(method_family = none)]
pub unsafe fn description(&self) -> Retained<NSString>;
#[cfg(feature = "NSString")]
#[unsafe(method(XMLString))]
#[unsafe(method_family = none)]
pub unsafe fn XMLString(&self) -> Retained<NSString>;
#[cfg(all(feature = "NSString", feature = "NSXMLNodeOptions"))]
#[unsafe(method(XMLStringWithOptions:))]
#[unsafe(method_family = none)]
pub unsafe fn XMLStringWithOptions(&self, options: NSXMLNodeOptions) -> Retained<NSString>;
#[cfg(feature = "NSString")]
#[unsafe(method(canonicalXMLStringPreservingComments:))]
#[unsafe(method_family = none)]
pub unsafe fn canonicalXMLStringPreservingComments(
&self,
comments: bool,
) -> Retained<NSString>;
#[cfg(all(feature = "NSArray", feature = "NSError", feature = "NSString"))]
#[unsafe(method(nodesForXPath:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn nodesForXPath_error(
&self,
xpath: &NSString,
) -> Result<Retained<NSArray<NSXMLNode>>, Retained<NSError>>;
#[cfg(all(
feature = "NSArray",
feature = "NSDictionary",
feature = "NSError",
feature = "NSString"
))]
#[unsafe(method(objectsForXQuery:constants:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn objectsForXQuery_constants_error(
&self,
xquery: &NSString,
constants: Option<&NSDictionary<NSString, AnyObject>>,
) -> Result<Retained<NSArray>, Retained<NSError>>;
#[cfg(all(feature = "NSArray", feature = "NSError", feature = "NSString"))]
#[unsafe(method(objectsForXQuery:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn objectsForXQuery_error(
&self,
xquery: &NSString,
) -> Result<Retained<NSArray>, Retained<NSError>>;
);
}
impl NSXMLNode {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}