use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use crate::*;
extern_class!(
#[unsafe(super(NSXMLNode, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "NSXMLNode")]
pub struct NSXMLElement;
);
#[cfg(all(feature = "NSObject", feature = "NSXMLNode"))]
extern_conformance!(
unsafe impl NSCopying for NSXMLElement {}
);
#[cfg(all(feature = "NSObject", feature = "NSXMLNode"))]
unsafe impl CopyingHelper for NSXMLElement {
type Result = Self;
}
#[cfg(feature = "NSXMLNode")]
extern_conformance!(
unsafe impl NSObjectProtocol for NSXMLElement {}
);
#[cfg(feature = "NSXMLNode")]
impl NSXMLElement {
extern_methods!(
#[cfg(feature = "NSString")]
#[unsafe(method(initWithName:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithName(this: Allocated<Self>, name: &NSString) -> Retained<Self>;
#[cfg(feature = "NSString")]
#[unsafe(method(initWithName:URI:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithName_URI(
this: Allocated<Self>,
name: &NSString,
uri: Option<&NSString>,
) -> Retained<Self>;
#[cfg(feature = "NSString")]
#[unsafe(method(initWithName:stringValue:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithName_stringValue(
this: Allocated<Self>,
name: &NSString,
string: Option<&NSString>,
) -> Retained<Self>;
#[cfg(all(feature = "NSError", feature = "NSString"))]
#[unsafe(method(initWithXMLString:error:_))]
#[unsafe(method_family = init)]
pub unsafe fn initWithXMLString_error(
this: Allocated<Self>,
string: &NSString,
) -> Result<Retained<Self>, Retained<NSError>>;
#[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>;
#[cfg(all(feature = "NSArray", feature = "NSString"))]
#[unsafe(method(elementsForName:))]
#[unsafe(method_family = none)]
pub unsafe fn elementsForName(&self, name: &NSString) -> Retained<NSArray<NSXMLElement>>;
#[cfg(all(feature = "NSArray", feature = "NSString"))]
#[unsafe(method(elementsForLocalName:URI:))]
#[unsafe(method_family = none)]
pub unsafe fn elementsForLocalName_URI(
&self,
local_name: &NSString,
uri: Option<&NSString>,
) -> Retained<NSArray<NSXMLElement>>;
#[unsafe(method(addAttribute:))]
#[unsafe(method_family = none)]
pub unsafe fn addAttribute(&self, attribute: &NSXMLNode);
#[cfg(feature = "NSString")]
#[unsafe(method(removeAttributeForName:))]
#[unsafe(method_family = none)]
pub unsafe fn removeAttributeForName(&self, name: &NSString);
#[cfg(feature = "NSArray")]
#[unsafe(method(attributes))]
#[unsafe(method_family = none)]
pub unsafe fn attributes(&self) -> Option<Retained<NSArray<NSXMLNode>>>;
#[cfg(feature = "NSArray")]
#[unsafe(method(setAttributes:))]
#[unsafe(method_family = none)]
pub unsafe fn setAttributes(&self, attributes: Option<&NSArray<NSXMLNode>>);
#[cfg(all(feature = "NSDictionary", feature = "NSString"))]
#[unsafe(method(setAttributesWithDictionary:))]
#[unsafe(method_family = none)]
pub unsafe fn setAttributesWithDictionary(
&self,
attributes: &NSDictionary<NSString, NSString>,
);
#[cfg(feature = "NSString")]
#[unsafe(method(attributeForName:))]
#[unsafe(method_family = none)]
pub unsafe fn attributeForName(&self, name: &NSString) -> Option<Retained<NSXMLNode>>;
#[cfg(feature = "NSString")]
#[unsafe(method(attributeForLocalName:URI:))]
#[unsafe(method_family = none)]
pub unsafe fn attributeForLocalName_URI(
&self,
local_name: &NSString,
uri: Option<&NSString>,
) -> Option<Retained<NSXMLNode>>;
#[unsafe(method(addNamespace:))]
#[unsafe(method_family = none)]
pub unsafe fn addNamespace(&self, a_namespace: &NSXMLNode);
#[cfg(feature = "NSString")]
#[unsafe(method(removeNamespaceForPrefix:))]
#[unsafe(method_family = none)]
pub unsafe fn removeNamespaceForPrefix(&self, name: &NSString);
#[cfg(feature = "NSArray")]
#[unsafe(method(namespaces))]
#[unsafe(method_family = none)]
pub unsafe fn namespaces(&self) -> Option<Retained<NSArray<NSXMLNode>>>;
#[cfg(feature = "NSArray")]
#[unsafe(method(setNamespaces:))]
#[unsafe(method_family = none)]
pub unsafe fn setNamespaces(&self, namespaces: Option<&NSArray<NSXMLNode>>);
#[cfg(feature = "NSString")]
#[unsafe(method(namespaceForPrefix:))]
#[unsafe(method_family = none)]
pub unsafe fn namespaceForPrefix(&self, name: &NSString) -> Option<Retained<NSXMLNode>>;
#[cfg(feature = "NSString")]
#[unsafe(method(resolveNamespaceForName:))]
#[unsafe(method_family = none)]
pub unsafe fn resolveNamespaceForName(
&self,
name: &NSString,
) -> Option<Retained<NSXMLNode>>;
#[cfg(feature = "NSString")]
#[unsafe(method(resolvePrefixForNamespaceURI:))]
#[unsafe(method_family = none)]
pub unsafe fn resolvePrefixForNamespaceURI(
&self,
namespace_uri: &NSString,
) -> Option<Retained<NSString>>;
#[unsafe(method(insertChild:atIndex:))]
#[unsafe(method_family = none)]
pub unsafe fn insertChild_atIndex(&self, child: &NSXMLNode, index: NSUInteger);
#[cfg(feature = "NSArray")]
#[unsafe(method(insertChildren:atIndex:))]
#[unsafe(method_family = none)]
pub unsafe fn insertChildren_atIndex(
&self,
children: &NSArray<NSXMLNode>,
index: NSUInteger,
);
#[unsafe(method(removeChildAtIndex:))]
#[unsafe(method_family = none)]
pub unsafe fn removeChildAtIndex(&self, index: NSUInteger);
#[cfg(feature = "NSArray")]
#[unsafe(method(setChildren:))]
#[unsafe(method_family = none)]
pub unsafe fn setChildren(&self, children: Option<&NSArray<NSXMLNode>>);
#[unsafe(method(addChild:))]
#[unsafe(method_family = none)]
pub unsafe fn addChild(&self, child: &NSXMLNode);
#[unsafe(method(replaceChildAtIndex:withNode:))]
#[unsafe(method_family = none)]
pub unsafe fn replaceChildAtIndex_withNode(&self, index: NSUInteger, node: &NSXMLNode);
#[unsafe(method(normalizeAdjacentTextNodesPreservingCDATA:))]
#[unsafe(method_family = none)]
pub unsafe fn normalizeAdjacentTextNodesPreservingCDATA(&self, preserve: bool);
);
}
#[cfg(feature = "NSXMLNode")]
impl NSXMLElement {
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 = "NSXMLNode")]
impl NSXMLElement {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
#[cfg(feature = "NSXMLNode")]
impl NSXMLElement {
extern_methods!(
#[cfg(feature = "NSDictionary")]
#[deprecated]
#[unsafe(method(setAttributesAsDictionary:))]
#[unsafe(method_family = none)]
pub unsafe fn setAttributesAsDictionary(&self, attributes: &NSDictionary);
);
}