objc2_foundation/generated/
NSXMLDTD.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10    /// Defines the order, repetition, and allowable values for a document
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nsxmldtd?language=objc)
13    #[unsafe(super(NSXMLNode, NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "NSXMLNode")]
16    pub struct NSXMLDTD;
17);
18
19#[cfg(all(feature = "NSObject", feature = "NSXMLNode"))]
20extern_conformance!(
21    unsafe impl NSCopying for NSXMLDTD {}
22);
23
24#[cfg(all(feature = "NSObject", feature = "NSXMLNode"))]
25unsafe impl CopyingHelper for NSXMLDTD {
26    type Result = Self;
27}
28
29#[cfg(feature = "NSXMLNode")]
30extern_conformance!(
31    unsafe impl NSObjectProtocol for NSXMLDTD {}
32);
33
34#[cfg(feature = "NSXMLNode")]
35impl NSXMLDTD {
36    extern_methods!(
37        #[unsafe(method(init))]
38        #[unsafe(method_family = init)]
39        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
40
41        #[cfg(feature = "NSXMLNodeOptions")]
42        #[unsafe(method(initWithKind:options:))]
43        #[unsafe(method_family = init)]
44        pub unsafe fn initWithKind_options(
45            this: Allocated<Self>,
46            kind: NSXMLNodeKind,
47            options: NSXMLNodeOptions,
48        ) -> Retained<Self>;
49
50        #[cfg(all(feature = "NSError", feature = "NSURL", feature = "NSXMLNodeOptions"))]
51        #[unsafe(method(initWithContentsOfURL:options:error:_))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn initWithContentsOfURL_options_error(
54            this: Allocated<Self>,
55            url: &NSURL,
56            mask: NSXMLNodeOptions,
57        ) -> Result<Retained<Self>, Retained<NSError>>;
58
59        #[cfg(all(feature = "NSData", feature = "NSError", feature = "NSXMLNodeOptions"))]
60        #[unsafe(method(initWithData:options:error:_))]
61        #[unsafe(method_family = init)]
62        pub unsafe fn initWithData_options_error(
63            this: Allocated<Self>,
64            data: &NSData,
65            mask: NSXMLNodeOptions,
66        ) -> Result<Retained<Self>, Retained<NSError>>;
67
68        #[cfg(feature = "NSString")]
69        /// Sets the public id. This identifier should be in the default catalog in /etc/xml/catalog or in a path specified by the environment variable XML_CATALOG_FILES. When the public id is set the system id must also be set.
70        #[unsafe(method(publicID))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn publicID(&self) -> Option<Retained<NSString>>;
73
74        #[cfg(feature = "NSString")]
75        /// Setter for [`publicID`][Self::publicID].
76        #[unsafe(method(setPublicID:))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn setPublicID(&self, public_id: Option<&NSString>);
79
80        #[cfg(feature = "NSString")]
81        /// Sets the system id. This should be a URL that points to a valid DTD.
82        #[unsafe(method(systemID))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn systemID(&self) -> Option<Retained<NSString>>;
85
86        #[cfg(feature = "NSString")]
87        /// Setter for [`systemID`][Self::systemID].
88        #[unsafe(method(setSystemID:))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn setSystemID(&self, system_id: Option<&NSString>);
91
92        /// Inserts a child at a particular index.
93        #[unsafe(method(insertChild:atIndex:))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn insertChild_atIndex(&self, child: &NSXMLNode, index: NSUInteger);
96
97        #[cfg(feature = "NSArray")]
98        /// Insert several children at a particular index.
99        #[unsafe(method(insertChildren:atIndex:))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn insertChildren_atIndex(
102            &self,
103            children: &NSArray<NSXMLNode>,
104            index: NSUInteger,
105        );
106
107        /// Removes a child at a particular index.
108        #[unsafe(method(removeChildAtIndex:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn removeChildAtIndex(&self, index: NSUInteger);
111
112        #[cfg(feature = "NSArray")]
113        /// Removes all existing children and replaces them with the new children. Set children to nil to simply remove all children.
114        #[unsafe(method(setChildren:))]
115        #[unsafe(method_family = none)]
116        pub unsafe fn setChildren(&self, children: Option<&NSArray<NSXMLNode>>);
117
118        /// Adds a child to the end of the existing children.
119        #[unsafe(method(addChild:))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn addChild(&self, child: &NSXMLNode);
122
123        /// Replaces a child at a particular index with another child.
124        #[unsafe(method(replaceChildAtIndex:withNode:))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn replaceChildAtIndex_withNode(&self, index: NSUInteger, node: &NSXMLNode);
127
128        #[cfg(all(feature = "NSString", feature = "NSXMLDTDNode"))]
129        /// Returns the entity declaration matching this name.
130        #[unsafe(method(entityDeclarationForName:))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn entityDeclarationForName(
133            &self,
134            name: &NSString,
135        ) -> Option<Retained<NSXMLDTDNode>>;
136
137        #[cfg(all(feature = "NSString", feature = "NSXMLDTDNode"))]
138        /// Returns the notation declaration matching this name.
139        #[unsafe(method(notationDeclarationForName:))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn notationDeclarationForName(
142            &self,
143            name: &NSString,
144        ) -> Option<Retained<NSXMLDTDNode>>;
145
146        #[cfg(all(feature = "NSString", feature = "NSXMLDTDNode"))]
147        /// Returns the element declaration matching this name.
148        #[unsafe(method(elementDeclarationForName:))]
149        #[unsafe(method_family = none)]
150        pub unsafe fn elementDeclarationForName(
151            &self,
152            name: &NSString,
153        ) -> Option<Retained<NSXMLDTDNode>>;
154
155        #[cfg(all(feature = "NSString", feature = "NSXMLDTDNode"))]
156        /// Returns the attribute declaration matching this name.
157        #[unsafe(method(attributeDeclarationForName:elementName:))]
158        #[unsafe(method_family = none)]
159        pub unsafe fn attributeDeclarationForName_elementName(
160            &self,
161            name: &NSString,
162            element_name: &NSString,
163        ) -> Option<Retained<NSXMLDTDNode>>;
164
165        #[cfg(all(feature = "NSString", feature = "NSXMLDTDNode"))]
166        /// Returns the predefined entity declaration matching this name.
167        ///
168        /// The five predefined entities are
169        /// <ul>
170        /// <li>
171        /// &
172        /// lt; -
173        /// <
174        /// </li>
175        /// <li>
176        /// &
177        /// gt; -
178        /// >
179        /// </li>
180        /// <li>
181        /// &
182        /// amp; -
183        /// &
184        /// </li>
185        /// <li>
186        /// &
187        /// quot; -
188        /// "
189        /// </li>
190        /// <li>
191        /// &
192        /// apos; -
193        /// &
194        /// </li>
195        /// </ul>
196        #[unsafe(method(predefinedEntityDeclarationForName:))]
197        #[unsafe(method_family = none)]
198        pub unsafe fn predefinedEntityDeclarationForName(
199            name: &NSString,
200        ) -> Option<Retained<NSXMLDTDNode>>;
201    );
202}
203
204/// Methods declared on superclass `NSXMLNode`.
205#[cfg(feature = "NSXMLNode")]
206impl NSXMLDTD {
207    extern_methods!(
208        /// Invokes
209        ///
210        /// ```text
211        ///  initWithKind:options:
212        /// ```
213        ///
214        /// with options set to NSXMLNodeOptionsNone
215        #[unsafe(method(initWithKind:))]
216        #[unsafe(method_family = init)]
217        pub unsafe fn initWithKind(this: Allocated<Self>, kind: NSXMLNodeKind) -> Retained<Self>;
218    );
219}
220
221/// Methods declared on superclass `NSObject`.
222#[cfg(feature = "NSXMLNode")]
223impl NSXMLDTD {
224    extern_methods!(
225        #[unsafe(method(new))]
226        #[unsafe(method_family = new)]
227        pub unsafe fn new() -> Retained<Self>;
228    );
229}