objc2_foundation/generated/
NSXMLDTDNode.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
9/// The subkind of a DTD node kind.
10///
11/// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nsxmldtdnodekind?language=objc)
12// NS_ENUM
13#[repr(transparent)]
14#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
15pub struct NSXMLDTDNodeKind(pub NSUInteger);
16impl NSXMLDTDNodeKind {
17    pub const NSXMLEntityGeneralKind: Self = Self(1);
18    pub const NSXMLEntityParsedKind: Self = Self(2);
19    pub const NSXMLEntityUnparsedKind: Self = Self(3);
20    pub const NSXMLEntityParameterKind: Self = Self(4);
21    pub const NSXMLEntityPredefined: Self = Self(5);
22    pub const NSXMLAttributeCDATAKind: Self = Self(6);
23    pub const NSXMLAttributeIDKind: Self = Self(7);
24    pub const NSXMLAttributeIDRefKind: Self = Self(8);
25    pub const NSXMLAttributeIDRefsKind: Self = Self(9);
26    pub const NSXMLAttributeEntityKind: Self = Self(10);
27    pub const NSXMLAttributeEntitiesKind: Self = Self(11);
28    pub const NSXMLAttributeNMTokenKind: Self = Self(12);
29    pub const NSXMLAttributeNMTokensKind: Self = Self(13);
30    pub const NSXMLAttributeEnumerationKind: Self = Self(14);
31    pub const NSXMLAttributeNotationKind: Self = Self(15);
32    pub const NSXMLElementDeclarationUndefinedKind: Self = Self(16);
33    pub const NSXMLElementDeclarationEmptyKind: Self = Self(17);
34    pub const NSXMLElementDeclarationAnyKind: Self = Self(18);
35    pub const NSXMLElementDeclarationMixedKind: Self = Self(19);
36    pub const NSXMLElementDeclarationElementKind: Self = Self(20);
37}
38
39unsafe impl Encode for NSXMLDTDNodeKind {
40    const ENCODING: Encoding = NSUInteger::ENCODING;
41}
42
43unsafe impl RefEncode for NSXMLDTDNodeKind {
44    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
45}
46
47extern_class!(
48    /// The nodes that are exclusive to a DTD
49    ///
50    /// Every DTD node has a name. Object value is defined as follows:
51    /// <ul>
52    /// <li>
53    /// <b>
54    /// Entity declaration
55    /// </b>
56    /// - the string that that entity resolves to eg "&lt;"
57    /// </li>
58    /// <li>
59    /// <b>
60    /// Attribute declaration
61    /// </b>
62    /// - the default value, if any
63    /// </li>
64    /// <li>
65    /// <b>
66    /// Element declaration
67    /// </b>
68    /// - the validation string
69    /// </li>
70    /// <li>
71    /// <b>
72    /// Notation declaration
73    /// </b>
74    /// - no objectValue
75    /// </li>
76    /// </ul>
77    ///
78    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nsxmldtdnode?language=objc)
79    #[unsafe(super(NSXMLNode, NSObject))]
80    #[derive(Debug, PartialEq, Eq, Hash)]
81    #[cfg(feature = "NSXMLNode")]
82    pub struct NSXMLDTDNode;
83);
84
85#[cfg(all(feature = "NSObject", feature = "NSXMLNode"))]
86extern_conformance!(
87    unsafe impl NSCopying for NSXMLDTDNode {}
88);
89
90#[cfg(all(feature = "NSObject", feature = "NSXMLNode"))]
91unsafe impl CopyingHelper for NSXMLDTDNode {
92    type Result = Self;
93}
94
95#[cfg(feature = "NSXMLNode")]
96extern_conformance!(
97    unsafe impl NSObjectProtocol for NSXMLDTDNode {}
98);
99
100#[cfg(feature = "NSXMLNode")]
101impl NSXMLDTDNode {
102    extern_methods!(
103        #[cfg(feature = "NSString")]
104        /// Returns an element, attribute, entity, or notation DTD node based on the full XML string.
105        #[unsafe(method(initWithXMLString:))]
106        #[unsafe(method_family = init)]
107        pub unsafe fn initWithXMLString(
108            this: Allocated<Self>,
109            string: &NSString,
110        ) -> Option<Retained<Self>>;
111
112        #[cfg(feature = "NSXMLNodeOptions")]
113        #[unsafe(method(initWithKind:options:))]
114        #[unsafe(method_family = init)]
115        pub unsafe fn initWithKind_options(
116            this: Allocated<Self>,
117            kind: NSXMLNodeKind,
118            options: NSXMLNodeOptions,
119        ) -> Retained<Self>;
120
121        #[unsafe(method(init))]
122        #[unsafe(method_family = init)]
123        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
124
125        /// Sets the DTD sub kind.
126        #[unsafe(method(DTDKind))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn DTDKind(&self) -> NSXMLDTDNodeKind;
129
130        /// Setter for [`DTDKind`][Self::DTDKind].
131        #[unsafe(method(setDTDKind:))]
132        #[unsafe(method_family = none)]
133        pub unsafe fn setDTDKind(&self, dtd_kind: NSXMLDTDNodeKind);
134
135        /// True if the system id is set. Valid for entities and notations.
136        #[unsafe(method(isExternal))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn isExternal(&self) -> bool;
139
140        #[cfg(feature = "NSString")]
141        /// 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. Valid for entities and notations.
142        #[unsafe(method(publicID))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn publicID(&self) -> Option<Retained<NSString>>;
145
146        #[cfg(feature = "NSString")]
147        /// Setter for [`publicID`][Self::publicID].
148        #[unsafe(method(setPublicID:))]
149        #[unsafe(method_family = none)]
150        pub unsafe fn setPublicID(&self, public_id: Option<&NSString>);
151
152        #[cfg(feature = "NSString")]
153        /// Sets the system id. This should be a URL that points to a valid DTD. Valid for entities and notations.
154        #[unsafe(method(systemID))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn systemID(&self) -> Option<Retained<NSString>>;
157
158        #[cfg(feature = "NSString")]
159        /// Setter for [`systemID`][Self::systemID].
160        #[unsafe(method(setSystemID:))]
161        #[unsafe(method_family = none)]
162        pub unsafe fn setSystemID(&self, system_id: Option<&NSString>);
163
164        #[cfg(feature = "NSString")]
165        /// Set the notation name. Valid for entities only.
166        #[unsafe(method(notationName))]
167        #[unsafe(method_family = none)]
168        pub unsafe fn notationName(&self) -> Option<Retained<NSString>>;
169
170        #[cfg(feature = "NSString")]
171        /// Setter for [`notationName`][Self::notationName].
172        #[unsafe(method(setNotationName:))]
173        #[unsafe(method_family = none)]
174        pub unsafe fn setNotationName(&self, notation_name: Option<&NSString>);
175    );
176}
177
178/// Methods declared on superclass `NSXMLNode`.
179#[cfg(feature = "NSXMLNode")]
180impl NSXMLDTDNode {
181    extern_methods!(
182        /// Invokes
183        ///
184        /// ```text
185        ///  initWithKind:options:
186        /// ```
187        ///
188        /// with options set to NSXMLNodeOptionsNone
189        #[unsafe(method(initWithKind:))]
190        #[unsafe(method_family = init)]
191        pub unsafe fn initWithKind(this: Allocated<Self>, kind: NSXMLNodeKind) -> Retained<Self>;
192    );
193}
194
195/// Methods declared on superclass `NSObject`.
196#[cfg(feature = "NSXMLNode")]
197impl NSXMLDTDNode {
198    extern_methods!(
199        #[unsafe(method(new))]
200        #[unsafe(method_family = new)]
201        pub unsafe fn new() -> Retained<Self>;
202    );
203}