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"))]
86unsafe impl NSCopying for NSXMLDTDNode {}
87
88#[cfg(all(feature = "NSObject", feature = "NSXMLNode"))]
89unsafe impl CopyingHelper for NSXMLDTDNode {
90    type Result = Self;
91}
92
93#[cfg(feature = "NSXMLNode")]
94unsafe impl NSObjectProtocol for NSXMLDTDNode {}
95
96#[cfg(feature = "NSXMLNode")]
97impl NSXMLDTDNode {
98    extern_methods!(
99        #[cfg(feature = "NSString")]
100        /// Returns an element, attribute, entity, or notation DTD node based on the full XML string.
101        #[unsafe(method(initWithXMLString:))]
102        #[unsafe(method_family = init)]
103        pub unsafe fn initWithXMLString(
104            this: Allocated<Self>,
105            string: &NSString,
106        ) -> Option<Retained<Self>>;
107
108        #[cfg(feature = "NSXMLNodeOptions")]
109        #[unsafe(method(initWithKind:options:))]
110        #[unsafe(method_family = init)]
111        pub unsafe fn initWithKind_options(
112            this: Allocated<Self>,
113            kind: NSXMLNodeKind,
114            options: NSXMLNodeOptions,
115        ) -> Retained<Self>;
116
117        #[unsafe(method(init))]
118        #[unsafe(method_family = init)]
119        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
120
121        /// Sets the DTD sub kind.
122        #[unsafe(method(DTDKind))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn DTDKind(&self) -> NSXMLDTDNodeKind;
125
126        /// Setter for [`DTDKind`][Self::DTDKind].
127        #[unsafe(method(setDTDKind:))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn setDTDKind(&self, dtd_kind: NSXMLDTDNodeKind);
130
131        /// True if the system id is set. Valid for entities and notations.
132        #[unsafe(method(isExternal))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn isExternal(&self) -> bool;
135
136        #[cfg(feature = "NSString")]
137        /// 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.
138        #[unsafe(method(publicID))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn publicID(&self) -> Option<Retained<NSString>>;
141
142        #[cfg(feature = "NSString")]
143        /// Setter for [`publicID`][Self::publicID].
144        #[unsafe(method(setPublicID:))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn setPublicID(&self, public_id: Option<&NSString>);
147
148        #[cfg(feature = "NSString")]
149        /// Sets the system id. This should be a URL that points to a valid DTD. Valid for entities and notations.
150        #[unsafe(method(systemID))]
151        #[unsafe(method_family = none)]
152        pub unsafe fn systemID(&self) -> Option<Retained<NSString>>;
153
154        #[cfg(feature = "NSString")]
155        /// Setter for [`systemID`][Self::systemID].
156        #[unsafe(method(setSystemID:))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn setSystemID(&self, system_id: Option<&NSString>);
159
160        #[cfg(feature = "NSString")]
161        /// Set the notation name. Valid for entities only.
162        #[unsafe(method(notationName))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn notationName(&self) -> Option<Retained<NSString>>;
165
166        #[cfg(feature = "NSString")]
167        /// Setter for [`notationName`][Self::notationName].
168        #[unsafe(method(setNotationName:))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn setNotationName(&self, notation_name: Option<&NSString>);
171    );
172}
173
174/// Methods declared on superclass `NSXMLNode`.
175#[cfg(feature = "NSXMLNode")]
176impl NSXMLDTDNode {
177    extern_methods!(
178        /// Invokes
179        ///
180        /// ```text
181        ///  initWithKind:options:
182        /// ```
183        ///
184        /// with options set to NSXMLNodeOptionsNone
185        #[unsafe(method(initWithKind:))]
186        #[unsafe(method_family = init)]
187        pub unsafe fn initWithKind(this: Allocated<Self>, kind: NSXMLNodeKind) -> Retained<Self>;
188    );
189}
190
191/// Methods declared on superclass `NSObject`.
192#[cfg(feature = "NSXMLNode")]
193impl NSXMLDTDNode {
194    extern_methods!(
195        #[unsafe(method(new))]
196        #[unsafe(method_family = new)]
197        pub unsafe fn new() -> Retained<Self>;
198    );
199}