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