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"))]
22unsafe impl NSCopying for NSXMLElement {}
23
24#[cfg(all(feature = "NSObject", feature = "NSXMLNode"))]
25unsafe impl CopyingHelper for NSXMLElement {
26 type Result = Self;
27}
28
29#[cfg(feature = "NSXMLNode")]
30unsafe impl NSObjectProtocol for NSXMLElement {}
31
32#[cfg(feature = "NSXMLNode")]
33impl NSXMLElement {
34 extern_methods!(
35 #[cfg(feature = "NSString")]
36 #[unsafe(method(initWithName:))]
45 #[unsafe(method_family = init)]
46 pub unsafe fn initWithName(this: Allocated<Self>, name: &NSString) -> Retained<Self>;
47
48 #[cfg(feature = "NSString")]
49 #[unsafe(method(initWithName:URI:))]
51 #[unsafe(method_family = init)]
52 pub unsafe fn initWithName_URI(
53 this: Allocated<Self>,
54 name: &NSString,
55 uri: Option<&NSString>,
56 ) -> Retained<Self>;
57
58 #[cfg(feature = "NSString")]
59 #[unsafe(method(initWithName:stringValue:))]
68 #[unsafe(method_family = init)]
69 pub unsafe fn initWithName_stringValue(
70 this: Allocated<Self>,
71 name: &NSString,
72 string: Option<&NSString>,
73 ) -> Retained<Self>;
74
75 #[cfg(all(feature = "NSError", feature = "NSString"))]
76 #[unsafe(method(initWithXMLString:error:_))]
82 #[unsafe(method_family = init)]
83 pub unsafe fn initWithXMLString_error(
84 this: Allocated<Self>,
85 string: &NSString,
86 ) -> Result<Retained<Self>, Retained<NSError>>;
87
88 #[cfg(feature = "NSXMLNodeOptions")]
89 #[unsafe(method(initWithKind:options:))]
90 #[unsafe(method_family = init)]
91 pub unsafe fn initWithKind_options(
92 this: Allocated<Self>,
93 kind: NSXMLNodeKind,
94 options: NSXMLNodeOptions,
95 ) -> Retained<Self>;
96
97 #[cfg(all(feature = "NSArray", feature = "NSString"))]
98 #[unsafe(method(elementsForName:))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn elementsForName(&self, name: &NSString) -> Retained<NSArray<NSXMLElement>>;
102
103 #[cfg(all(feature = "NSArray", feature = "NSString"))]
104 #[unsafe(method(elementsForLocalName:URI:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn elementsForLocalName_URI(
108 &self,
109 local_name: &NSString,
110 uri: Option<&NSString>,
111 ) -> Retained<NSArray<NSXMLElement>>;
112
113 #[unsafe(method(addAttribute:))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn addAttribute(&self, attribute: &NSXMLNode);
117
118 #[cfg(feature = "NSString")]
119 #[unsafe(method(removeAttributeForName:))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn removeAttributeForName(&self, name: &NSString);
123
124 #[cfg(feature = "NSArray")]
125 #[unsafe(method(attributes))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn attributes(&self) -> Option<Retained<NSArray<NSXMLNode>>>;
129
130 #[cfg(feature = "NSArray")]
131 #[unsafe(method(setAttributes:))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn setAttributes(&self, attributes: Option<&NSArray<NSXMLNode>>);
135
136 #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
137 #[unsafe(method(setAttributesWithDictionary:))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn setAttributesWithDictionary(
141 &self,
142 attributes: &NSDictionary<NSString, NSString>,
143 );
144
145 #[cfg(feature = "NSString")]
146 #[unsafe(method(attributeForName:))]
148 #[unsafe(method_family = none)]
149 pub unsafe fn attributeForName(&self, name: &NSString) -> Option<Retained<NSXMLNode>>;
150
151 #[cfg(feature = "NSString")]
152 #[unsafe(method(attributeForLocalName:URI:))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn attributeForLocalName_URI(
156 &self,
157 local_name: &NSString,
158 uri: Option<&NSString>,
159 ) -> Option<Retained<NSXMLNode>>;
160
161 #[unsafe(method(addNamespace:))]
163 #[unsafe(method_family = none)]
164 pub unsafe fn addNamespace(&self, a_namespace: &NSXMLNode);
165
166 #[cfg(feature = "NSString")]
167 #[unsafe(method(removeNamespaceForPrefix:))]
169 #[unsafe(method_family = none)]
170 pub unsafe fn removeNamespaceForPrefix(&self, name: &NSString);
171
172 #[cfg(feature = "NSArray")]
173 #[unsafe(method(namespaces))]
175 #[unsafe(method_family = none)]
176 pub unsafe fn namespaces(&self) -> Option<Retained<NSArray<NSXMLNode>>>;
177
178 #[cfg(feature = "NSArray")]
179 #[unsafe(method(setNamespaces:))]
181 #[unsafe(method_family = none)]
182 pub unsafe fn setNamespaces(&self, namespaces: Option<&NSArray<NSXMLNode>>);
183
184 #[cfg(feature = "NSString")]
185 #[unsafe(method(namespaceForPrefix:))]
187 #[unsafe(method_family = none)]
188 pub unsafe fn namespaceForPrefix(&self, name: &NSString) -> Option<Retained<NSXMLNode>>;
189
190 #[cfg(feature = "NSString")]
191 #[unsafe(method(resolveNamespaceForName:))]
193 #[unsafe(method_family = none)]
194 pub unsafe fn resolveNamespaceForName(
195 &self,
196 name: &NSString,
197 ) -> Option<Retained<NSXMLNode>>;
198
199 #[cfg(feature = "NSString")]
200 #[unsafe(method(resolvePrefixForNamespaceURI:))]
202 #[unsafe(method_family = none)]
203 pub unsafe fn resolvePrefixForNamespaceURI(
204 &self,
205 namespace_uri: &NSString,
206 ) -> Option<Retained<NSString>>;
207
208 #[unsafe(method(insertChild:atIndex:))]
210 #[unsafe(method_family = none)]
211 pub unsafe fn insertChild_atIndex(&self, child: &NSXMLNode, index: NSUInteger);
212
213 #[cfg(feature = "NSArray")]
214 #[unsafe(method(insertChildren:atIndex:))]
216 #[unsafe(method_family = none)]
217 pub unsafe fn insertChildren_atIndex(
218 &self,
219 children: &NSArray<NSXMLNode>,
220 index: NSUInteger,
221 );
222
223 #[unsafe(method(removeChildAtIndex:))]
225 #[unsafe(method_family = none)]
226 pub unsafe fn removeChildAtIndex(&self, index: NSUInteger);
227
228 #[cfg(feature = "NSArray")]
229 #[unsafe(method(setChildren:))]
231 #[unsafe(method_family = none)]
232 pub unsafe fn setChildren(&self, children: Option<&NSArray<NSXMLNode>>);
233
234 #[unsafe(method(addChild:))]
236 #[unsafe(method_family = none)]
237 pub unsafe fn addChild(&self, child: &NSXMLNode);
238
239 #[unsafe(method(replaceChildAtIndex:withNode:))]
241 #[unsafe(method_family = none)]
242 pub unsafe fn replaceChildAtIndex_withNode(&self, index: NSUInteger, node: &NSXMLNode);
243
244 #[unsafe(method(normalizeAdjacentTextNodesPreservingCDATA:))]
246 #[unsafe(method_family = none)]
247 pub unsafe fn normalizeAdjacentTextNodesPreservingCDATA(&self, preserve: bool);
248 );
249}
250
251#[cfg(feature = "NSXMLNode")]
253impl NSXMLElement {
254 extern_methods!(
255 #[unsafe(method(init))]
256 #[unsafe(method_family = init)]
257 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
258
259 #[unsafe(method(initWithKind:))]
267 #[unsafe(method_family = init)]
268 pub unsafe fn initWithKind(this: Allocated<Self>, kind: NSXMLNodeKind) -> Retained<Self>;
269 );
270}
271
272#[cfg(feature = "NSXMLNode")]
274impl NSXMLElement {
275 extern_methods!(
276 #[unsafe(method(new))]
277 #[unsafe(method_family = new)]
278 pub unsafe fn new() -> Retained<Self>;
279 );
280}
281
282#[cfg(feature = "NSXMLNode")]
284impl NSXMLElement {
285 extern_methods!(
286 #[cfg(feature = "NSDictionary")]
287 #[deprecated]
291 #[unsafe(method(setAttributesAsDictionary:))]
292 #[unsafe(method_family = none)]
293 pub unsafe fn setAttributesAsDictionary(&self, attributes: &NSDictionary);
294 );
295}