objc2_foundation/generated/
NSXMLElement.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10 #[unsafe(super(NSXMLNode, NSObject))]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 #[cfg(feature = "NSXMLNode")]
18 pub struct NSXMLElement;
19);
20
21#[cfg(all(feature = "NSObject", feature = "NSXMLNode"))]
22extern_conformance!(
23 unsafe impl NSCopying for NSXMLElement {}
24);
25
26#[cfg(all(feature = "NSObject", feature = "NSXMLNode"))]
27unsafe impl CopyingHelper for NSXMLElement {
28 type Result = Self;
29}
30
31#[cfg(feature = "NSXMLNode")]
32extern_conformance!(
33 unsafe impl NSObjectProtocol for NSXMLElement {}
34);
35
36#[cfg(feature = "NSXMLNode")]
37impl NSXMLElement {
38 extern_methods!(
39 #[cfg(feature = "NSString")]
40 #[unsafe(method(initWithName:))]
49 #[unsafe(method_family = init)]
50 pub fn initWithName(this: Allocated<Self>, name: &NSString) -> Retained<Self>;
51
52 #[cfg(feature = "NSString")]
53 #[unsafe(method(initWithName:URI:))]
55 #[unsafe(method_family = init)]
56 pub fn initWithName_URI(
57 this: Allocated<Self>,
58 name: &NSString,
59 uri: Option<&NSString>,
60 ) -> Retained<Self>;
61
62 #[cfg(feature = "NSString")]
63 #[unsafe(method(initWithName:stringValue:))]
72 #[unsafe(method_family = init)]
73 pub fn initWithName_stringValue(
74 this: Allocated<Self>,
75 name: &NSString,
76 string: Option<&NSString>,
77 ) -> Retained<Self>;
78
79 #[cfg(all(feature = "NSError", feature = "NSString"))]
80 #[unsafe(method(initWithXMLString:error:_))]
86 #[unsafe(method_family = init)]
87 pub fn initWithXMLString_error(
88 this: Allocated<Self>,
89 string: &NSString,
90 ) -> Result<Retained<Self>, Retained<NSError>>;
91
92 #[cfg(feature = "NSXMLNodeOptions")]
93 #[unsafe(method(initWithKind:options:))]
94 #[unsafe(method_family = init)]
95 pub fn initWithKind_options(
96 this: Allocated<Self>,
97 kind: NSXMLNodeKind,
98 options: NSXMLNodeOptions,
99 ) -> Retained<Self>;
100
101 #[cfg(all(feature = "NSArray", feature = "NSString"))]
102 #[unsafe(method(elementsForName:))]
104 #[unsafe(method_family = none)]
105 pub fn elementsForName(&self, name: &NSString) -> Retained<NSArray<NSXMLElement>>;
106
107 #[cfg(all(feature = "NSArray", feature = "NSString"))]
108 #[unsafe(method(elementsForLocalName:URI:))]
110 #[unsafe(method_family = none)]
111 pub fn elementsForLocalName_URI(
112 &self,
113 local_name: &NSString,
114 uri: Option<&NSString>,
115 ) -> Retained<NSArray<NSXMLElement>>;
116
117 #[unsafe(method(addAttribute:))]
119 #[unsafe(method_family = none)]
120 pub fn addAttribute(&self, attribute: &NSXMLNode);
121
122 #[cfg(feature = "NSString")]
123 #[unsafe(method(removeAttributeForName:))]
125 #[unsafe(method_family = none)]
126 pub fn removeAttributeForName(&self, name: &NSString);
127
128 #[cfg(feature = "NSArray")]
129 #[unsafe(method(attributes))]
131 #[unsafe(method_family = none)]
132 pub fn attributes(&self) -> Option<Retained<NSArray<NSXMLNode>>>;
133
134 #[cfg(feature = "NSArray")]
135 #[unsafe(method(setAttributes:))]
139 #[unsafe(method_family = none)]
140 pub fn setAttributes(&self, attributes: Option<&NSArray<NSXMLNode>>);
141
142 #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
143 #[unsafe(method(setAttributesWithDictionary:))]
145 #[unsafe(method_family = none)]
146 pub fn setAttributesWithDictionary(&self, attributes: &NSDictionary<NSString, NSString>);
147
148 #[cfg(feature = "NSString")]
149 #[unsafe(method(attributeForName:))]
151 #[unsafe(method_family = none)]
152 pub fn attributeForName(&self, name: &NSString) -> Option<Retained<NSXMLNode>>;
153
154 #[cfg(feature = "NSString")]
155 #[unsafe(method(attributeForLocalName:URI:))]
157 #[unsafe(method_family = none)]
158 pub fn attributeForLocalName_URI(
159 &self,
160 local_name: &NSString,
161 uri: Option<&NSString>,
162 ) -> Option<Retained<NSXMLNode>>;
163
164 #[unsafe(method(addNamespace:))]
166 #[unsafe(method_family = none)]
167 pub fn addNamespace(&self, a_namespace: &NSXMLNode);
168
169 #[cfg(feature = "NSString")]
170 #[unsafe(method(removeNamespaceForPrefix:))]
172 #[unsafe(method_family = none)]
173 pub fn removeNamespaceForPrefix(&self, name: &NSString);
174
175 #[cfg(feature = "NSArray")]
176 #[unsafe(method(namespaces))]
178 #[unsafe(method_family = none)]
179 pub fn namespaces(&self) -> Option<Retained<NSArray<NSXMLNode>>>;
180
181 #[cfg(feature = "NSArray")]
182 #[unsafe(method(setNamespaces:))]
186 #[unsafe(method_family = none)]
187 pub fn setNamespaces(&self, namespaces: Option<&NSArray<NSXMLNode>>);
188
189 #[cfg(feature = "NSString")]
190 #[unsafe(method(namespaceForPrefix:))]
192 #[unsafe(method_family = none)]
193 pub fn namespaceForPrefix(&self, name: &NSString) -> Option<Retained<NSXMLNode>>;
194
195 #[cfg(feature = "NSString")]
196 #[unsafe(method(resolveNamespaceForName:))]
198 #[unsafe(method_family = none)]
199 pub fn resolveNamespaceForName(&self, name: &NSString) -> Option<Retained<NSXMLNode>>;
200
201 #[cfg(feature = "NSString")]
202 #[unsafe(method(resolvePrefixForNamespaceURI:))]
204 #[unsafe(method_family = none)]
205 pub fn resolvePrefixForNamespaceURI(
206 &self,
207 namespace_uri: &NSString,
208 ) -> Option<Retained<NSString>>;
209
210 #[unsafe(method(insertChild:atIndex:))]
212 #[unsafe(method_family = none)]
213 pub fn insertChild_atIndex(&self, child: &NSXMLNode, index: NSUInteger);
214
215 #[cfg(feature = "NSArray")]
216 #[unsafe(method(insertChildren:atIndex:))]
218 #[unsafe(method_family = none)]
219 pub fn insertChildren_atIndex(&self, children: &NSArray<NSXMLNode>, index: NSUInteger);
220
221 #[unsafe(method(removeChildAtIndex:))]
223 #[unsafe(method_family = none)]
224 pub fn removeChildAtIndex(&self, index: NSUInteger);
225
226 #[cfg(feature = "NSArray")]
227 #[unsafe(method(setChildren:))]
229 #[unsafe(method_family = none)]
230 pub fn setChildren(&self, children: Option<&NSArray<NSXMLNode>>);
231
232 #[unsafe(method(addChild:))]
234 #[unsafe(method_family = none)]
235 pub fn addChild(&self, child: &NSXMLNode);
236
237 #[unsafe(method(replaceChildAtIndex:withNode:))]
239 #[unsafe(method_family = none)]
240 pub fn replaceChildAtIndex_withNode(&self, index: NSUInteger, node: &NSXMLNode);
241
242 #[unsafe(method(normalizeAdjacentTextNodesPreservingCDATA:))]
244 #[unsafe(method_family = none)]
245 pub fn normalizeAdjacentTextNodesPreservingCDATA(&self, preserve: bool);
246 );
247}
248
249#[cfg(feature = "NSXMLNode")]
251impl NSXMLElement {
252 extern_methods!(
253 #[unsafe(method(init))]
254 #[unsafe(method_family = init)]
255 pub fn init(this: Allocated<Self>) -> Retained<Self>;
256
257 #[unsafe(method(initWithKind:))]
265 #[unsafe(method_family = init)]
266 pub fn initWithKind(this: Allocated<Self>, kind: NSXMLNodeKind) -> Retained<Self>;
267 );
268}
269
270#[cfg(feature = "NSXMLNode")]
272impl NSXMLElement {
273 extern_methods!(
274 #[unsafe(method(new))]
275 #[unsafe(method_family = new)]
276 pub fn new() -> Retained<Self>;
277 );
278}
279
280#[cfg(feature = "NSXMLNode")]
281impl DefaultRetained for NSXMLElement {
282 #[inline]
283 fn default_retained() -> Retained<Self> {
284 Self::new()
285 }
286}
287
288#[cfg(feature = "NSXMLNode")]
290impl NSXMLElement {
291 extern_methods!(
292 #[cfg(feature = "NSDictionary")]
293 #[deprecated]
301 #[unsafe(method(setAttributesAsDictionary:))]
302 #[unsafe(method_family = none)]
303 pub unsafe fn setAttributesAsDictionary(&self, attributes: &NSDictionary);
304 );
305}