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 unsafe 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 unsafe 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 unsafe 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 unsafe 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 unsafe 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 unsafe 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 unsafe 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 unsafe fn addAttribute(&self, attribute: &NSXMLNode);
121
122 #[cfg(feature = "NSString")]
123 #[unsafe(method(removeAttributeForName:))]
125 #[unsafe(method_family = none)]
126 pub unsafe fn removeAttributeForName(&self, name: &NSString);
127
128 #[cfg(feature = "NSArray")]
129 #[unsafe(method(attributes))]
131 #[unsafe(method_family = none)]
132 pub unsafe fn attributes(&self) -> Option<Retained<NSArray<NSXMLNode>>>;
133
134 #[cfg(feature = "NSArray")]
135 #[unsafe(method(setAttributes:))]
137 #[unsafe(method_family = none)]
138 pub unsafe fn setAttributes(&self, attributes: Option<&NSArray<NSXMLNode>>);
139
140 #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
141 #[unsafe(method(setAttributesWithDictionary:))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn setAttributesWithDictionary(
145 &self,
146 attributes: &NSDictionary<NSString, NSString>,
147 );
148
149 #[cfg(feature = "NSString")]
150 #[unsafe(method(attributeForName:))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn attributeForName(&self, name: &NSString) -> Option<Retained<NSXMLNode>>;
154
155 #[cfg(feature = "NSString")]
156 #[unsafe(method(attributeForLocalName:URI:))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn attributeForLocalName_URI(
160 &self,
161 local_name: &NSString,
162 uri: Option<&NSString>,
163 ) -> Option<Retained<NSXMLNode>>;
164
165 #[unsafe(method(addNamespace:))]
167 #[unsafe(method_family = none)]
168 pub unsafe fn addNamespace(&self, a_namespace: &NSXMLNode);
169
170 #[cfg(feature = "NSString")]
171 #[unsafe(method(removeNamespaceForPrefix:))]
173 #[unsafe(method_family = none)]
174 pub unsafe fn removeNamespaceForPrefix(&self, name: &NSString);
175
176 #[cfg(feature = "NSArray")]
177 #[unsafe(method(namespaces))]
179 #[unsafe(method_family = none)]
180 pub unsafe fn namespaces(&self) -> Option<Retained<NSArray<NSXMLNode>>>;
181
182 #[cfg(feature = "NSArray")]
183 #[unsafe(method(setNamespaces:))]
185 #[unsafe(method_family = none)]
186 pub unsafe fn setNamespaces(&self, namespaces: Option<&NSArray<NSXMLNode>>);
187
188 #[cfg(feature = "NSString")]
189 #[unsafe(method(namespaceForPrefix:))]
191 #[unsafe(method_family = none)]
192 pub unsafe fn namespaceForPrefix(&self, name: &NSString) -> Option<Retained<NSXMLNode>>;
193
194 #[cfg(feature = "NSString")]
195 #[unsafe(method(resolveNamespaceForName:))]
197 #[unsafe(method_family = none)]
198 pub unsafe fn resolveNamespaceForName(
199 &self,
200 name: &NSString,
201 ) -> Option<Retained<NSXMLNode>>;
202
203 #[cfg(feature = "NSString")]
204 #[unsafe(method(resolvePrefixForNamespaceURI:))]
206 #[unsafe(method_family = none)]
207 pub unsafe fn resolvePrefixForNamespaceURI(
208 &self,
209 namespace_uri: &NSString,
210 ) -> Option<Retained<NSString>>;
211
212 #[unsafe(method(insertChild:atIndex:))]
214 #[unsafe(method_family = none)]
215 pub unsafe fn insertChild_atIndex(&self, child: &NSXMLNode, index: NSUInteger);
216
217 #[cfg(feature = "NSArray")]
218 #[unsafe(method(insertChildren:atIndex:))]
220 #[unsafe(method_family = none)]
221 pub unsafe fn insertChildren_atIndex(
222 &self,
223 children: &NSArray<NSXMLNode>,
224 index: NSUInteger,
225 );
226
227 #[unsafe(method(removeChildAtIndex:))]
229 #[unsafe(method_family = none)]
230 pub unsafe fn removeChildAtIndex(&self, index: NSUInteger);
231
232 #[cfg(feature = "NSArray")]
233 #[unsafe(method(setChildren:))]
235 #[unsafe(method_family = none)]
236 pub unsafe fn setChildren(&self, children: Option<&NSArray<NSXMLNode>>);
237
238 #[unsafe(method(addChild:))]
240 #[unsafe(method_family = none)]
241 pub unsafe fn addChild(&self, child: &NSXMLNode);
242
243 #[unsafe(method(replaceChildAtIndex:withNode:))]
245 #[unsafe(method_family = none)]
246 pub unsafe fn replaceChildAtIndex_withNode(&self, index: NSUInteger, node: &NSXMLNode);
247
248 #[unsafe(method(normalizeAdjacentTextNodesPreservingCDATA:))]
250 #[unsafe(method_family = none)]
251 pub unsafe fn normalizeAdjacentTextNodesPreservingCDATA(&self, preserve: bool);
252 );
253}
254
255#[cfg(feature = "NSXMLNode")]
257impl NSXMLElement {
258 extern_methods!(
259 #[unsafe(method(init))]
260 #[unsafe(method_family = init)]
261 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
262
263 #[unsafe(method(initWithKind:))]
271 #[unsafe(method_family = init)]
272 pub unsafe fn initWithKind(this: Allocated<Self>, kind: NSXMLNodeKind) -> Retained<Self>;
273 );
274}
275
276#[cfg(feature = "NSXMLNode")]
278impl NSXMLElement {
279 extern_methods!(
280 #[unsafe(method(new))]
281 #[unsafe(method_family = new)]
282 pub unsafe fn new() -> Retained<Self>;
283 );
284}
285
286#[cfg(feature = "NSXMLNode")]
288impl NSXMLElement {
289 extern_methods!(
290 #[cfg(feature = "NSDictionary")]
291 #[deprecated]
295 #[unsafe(method(setAttributesAsDictionary:))]
296 #[unsafe(method_family = none)]
297 pub unsafe fn setAttributesAsDictionary(&self, attributes: &NSDictionary);
298 );
299}