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 fn init(this: Allocated<Self>) -> Retained<Self>;
40
41        #[cfg(feature = "NSXMLNodeOptions")]
42        #[unsafe(method(initWithKind:options:))]
43        #[unsafe(method_family = init)]
44        pub 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 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 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 fn publicID(&self) -> Option<Retained<NSString>>;
73
74        #[cfg(feature = "NSString")]
75        /// Setter for [`publicID`][Self::publicID].
76        ///
77        /// This is [copied][crate::NSCopying::copy] when set.
78        #[unsafe(method(setPublicID:))]
79        #[unsafe(method_family = none)]
80        pub fn setPublicID(&self, public_id: Option<&NSString>);
81
82        #[cfg(feature = "NSString")]
83        /// Sets the system id. This should be a URL that points to a valid DTD.
84        #[unsafe(method(systemID))]
85        #[unsafe(method_family = none)]
86        pub fn systemID(&self) -> Option<Retained<NSString>>;
87
88        #[cfg(feature = "NSString")]
89        /// Setter for [`systemID`][Self::systemID].
90        ///
91        /// This is [copied][crate::NSCopying::copy] when set.
92        #[unsafe(method(setSystemID:))]
93        #[unsafe(method_family = none)]
94        pub fn setSystemID(&self, system_id: Option<&NSString>);
95
96        /// Inserts a child at a particular index.
97        #[unsafe(method(insertChild:atIndex:))]
98        #[unsafe(method_family = none)]
99        pub fn insertChild_atIndex(&self, child: &NSXMLNode, index: NSUInteger);
100
101        #[cfg(feature = "NSArray")]
102        /// Insert several children at a particular index.
103        #[unsafe(method(insertChildren:atIndex:))]
104        #[unsafe(method_family = none)]
105        pub fn insertChildren_atIndex(&self, children: &NSArray<NSXMLNode>, index: NSUInteger);
106
107        /// Removes a child at a particular index.
108        #[unsafe(method(removeChildAtIndex:))]
109        #[unsafe(method_family = none)]
110        pub 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 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 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 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 fn entityDeclarationForName(&self, name: &NSString) -> Option<Retained<NSXMLDTDNode>>;
133
134        #[cfg(all(feature = "NSString", feature = "NSXMLDTDNode"))]
135        /// Returns the notation declaration matching this name.
136        #[unsafe(method(notationDeclarationForName:))]
137        #[unsafe(method_family = none)]
138        pub fn notationDeclarationForName(&self, name: &NSString)
139            -> Option<Retained<NSXMLDTDNode>>;
140
141        #[cfg(all(feature = "NSString", feature = "NSXMLDTDNode"))]
142        /// Returns the element declaration matching this name.
143        #[unsafe(method(elementDeclarationForName:))]
144        #[unsafe(method_family = none)]
145        pub fn elementDeclarationForName(&self, name: &NSString) -> Option<Retained<NSXMLDTDNode>>;
146
147        #[cfg(all(feature = "NSString", feature = "NSXMLDTDNode"))]
148        /// Returns the attribute declaration matching this name.
149        #[unsafe(method(attributeDeclarationForName:elementName:))]
150        #[unsafe(method_family = none)]
151        pub fn attributeDeclarationForName_elementName(
152            &self,
153            name: &NSString,
154            element_name: &NSString,
155        ) -> Option<Retained<NSXMLDTDNode>>;
156
157        #[cfg(all(feature = "NSString", feature = "NSXMLDTDNode"))]
158        /// Returns the predefined entity declaration matching this name.
159        ///
160        /// The five predefined entities are
161        /// <ul>
162        /// <li>
163        /// &
164        /// lt; -
165        /// <
166        /// </li>
167        /// <li>
168        /// &
169        /// gt; -
170        /// >
171        /// </li>
172        /// <li>
173        /// &
174        /// amp; -
175        /// &
176        /// </li>
177        /// <li>
178        /// &
179        /// quot; -
180        /// "
181        /// </li>
182        /// <li>
183        /// &
184        /// apos; -
185        /// &
186        /// </li>
187        /// </ul>
188        #[unsafe(method(predefinedEntityDeclarationForName:))]
189        #[unsafe(method_family = none)]
190        pub fn predefinedEntityDeclarationForName(
191            name: &NSString,
192        ) -> Option<Retained<NSXMLDTDNode>>;
193    );
194}
195
196/// Methods declared on superclass `NSXMLNode`.
197#[cfg(feature = "NSXMLNode")]
198impl NSXMLDTD {
199    extern_methods!(
200        /// Invokes
201        ///
202        /// ```text
203        ///  initWithKind:options:
204        /// ```
205        ///
206        /// with options set to NSXMLNodeOptionsNone
207        #[unsafe(method(initWithKind:))]
208        #[unsafe(method_family = init)]
209        pub fn initWithKind(this: Allocated<Self>, kind: NSXMLNodeKind) -> Retained<Self>;
210    );
211}
212
213/// Methods declared on superclass `NSObject`.
214#[cfg(feature = "NSXMLNode")]
215impl NSXMLDTD {
216    extern_methods!(
217        #[unsafe(method(new))]
218        #[unsafe(method_family = new)]
219        pub fn new() -> Retained<Self>;
220    );
221}
222
223#[cfg(feature = "NSXMLNode")]
224impl DefaultRetained for NSXMLDTD {
225    #[inline]
226    fn default_retained() -> Retained<Self> {
227        Self::new()
228    }
229}