objc2_web_kit/generated/
DOMHTMLSelectElement.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/domhtmlselectelement?language=objc)
12    #[unsafe(super(
13        DOMHTMLElement,
14        DOMElement,
15        DOMNode,
16        DOMObject,
17        WebScriptObject,
18        NSObject
19    ))]
20    #[derive(Debug, PartialEq, Eq, Hash)]
21    #[cfg(all(
22        feature = "DOMElement",
23        feature = "DOMHTMLElement",
24        feature = "DOMNode",
25        feature = "DOMObject",
26        feature = "WebScriptObject"
27    ))]
28    #[deprecated]
29    pub struct DOMHTMLSelectElement;
30);
31
32#[cfg(all(
33    feature = "DOMElement",
34    feature = "DOMEventTarget",
35    feature = "DOMHTMLElement",
36    feature = "DOMNode",
37    feature = "DOMObject",
38    feature = "WebScriptObject"
39))]
40extern_conformance!(
41    unsafe impl DOMEventTarget for DOMHTMLSelectElement {}
42);
43
44#[cfg(all(
45    feature = "DOMElement",
46    feature = "DOMHTMLElement",
47    feature = "DOMNode",
48    feature = "DOMObject",
49    feature = "WebScriptObject"
50))]
51extern_conformance!(
52    unsafe impl NSCopying for DOMHTMLSelectElement {}
53);
54
55#[cfg(all(
56    feature = "DOMElement",
57    feature = "DOMHTMLElement",
58    feature = "DOMNode",
59    feature = "DOMObject",
60    feature = "WebScriptObject"
61))]
62unsafe impl CopyingHelper for DOMHTMLSelectElement {
63    type Result = Self;
64}
65
66#[cfg(all(
67    feature = "DOMElement",
68    feature = "DOMHTMLElement",
69    feature = "DOMNode",
70    feature = "DOMObject",
71    feature = "WebScriptObject"
72))]
73extern_conformance!(
74    unsafe impl NSObjectProtocol for DOMHTMLSelectElement {}
75);
76
77#[cfg(all(
78    feature = "DOMElement",
79    feature = "DOMHTMLElement",
80    feature = "DOMNode",
81    feature = "DOMObject",
82    feature = "WebScriptObject"
83))]
84impl DOMHTMLSelectElement {
85    extern_methods!(
86        #[unsafe(method(autofocus))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn autofocus(&self) -> bool;
89
90        /// Setter for [`autofocus`][Self::autofocus].
91        #[unsafe(method(setAutofocus:))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn setAutofocus(&self, autofocus: bool);
94
95        #[deprecated]
96        #[unsafe(method(disabled))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn disabled(&self) -> bool;
99
100        /// Setter for [`disabled`][Self::disabled].
101        #[deprecated]
102        #[unsafe(method(setDisabled:))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn setDisabled(&self, disabled: bool);
105
106        #[cfg(feature = "DOMHTMLFormElement")]
107        #[deprecated]
108        #[unsafe(method(form))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn form(&self) -> Option<Retained<DOMHTMLFormElement>>;
111
112        #[deprecated]
113        #[unsafe(method(multiple))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn multiple(&self) -> bool;
116
117        /// Setter for [`multiple`][Self::multiple].
118        #[deprecated]
119        #[unsafe(method(setMultiple:))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn setMultiple(&self, multiple: bool);
122
123        #[deprecated]
124        #[unsafe(method(name))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn name(&self) -> Retained<NSString>;
127
128        /// Setter for [`name`][Self::name].
129        ///
130        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
131        #[deprecated]
132        #[unsafe(method(setName:))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn setName(&self, name: Option<&NSString>);
135
136        #[deprecated]
137        #[unsafe(method(size))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn size(&self) -> c_int;
140
141        /// Setter for [`size`][Self::size].
142        #[deprecated]
143        #[unsafe(method(setSize:))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn setSize(&self, size: c_int);
146
147        #[deprecated]
148        #[unsafe(method(type))]
149        #[unsafe(method_family = none)]
150        pub unsafe fn r#type(&self) -> Retained<NSString>;
151
152        #[cfg(feature = "DOMHTMLOptionsCollection")]
153        #[deprecated]
154        #[unsafe(method(options))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn options(&self) -> Option<Retained<DOMHTMLOptionsCollection>>;
157
158        #[deprecated]
159        #[unsafe(method(length))]
160        #[unsafe(method_family = none)]
161        pub unsafe fn length(&self) -> c_int;
162
163        #[deprecated]
164        #[unsafe(method(selectedIndex))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn selectedIndex(&self) -> c_int;
167
168        /// Setter for [`selectedIndex`][Self::selectedIndex].
169        #[deprecated]
170        #[unsafe(method(setSelectedIndex:))]
171        #[unsafe(method_family = none)]
172        pub unsafe fn setSelectedIndex(&self, selected_index: c_int);
173
174        #[deprecated]
175        #[unsafe(method(value))]
176        #[unsafe(method_family = none)]
177        pub unsafe fn value(&self) -> Retained<NSString>;
178
179        /// Setter for [`value`][Self::value].
180        ///
181        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
182        #[deprecated]
183        #[unsafe(method(setValue:))]
184        #[unsafe(method_family = none)]
185        pub unsafe fn setValue(&self, value: Option<&NSString>);
186
187        #[unsafe(method(willValidate))]
188        #[unsafe(method_family = none)]
189        pub unsafe fn willValidate(&self) -> bool;
190
191        #[unsafe(method(item:))]
192        #[unsafe(method_family = none)]
193        pub unsafe fn item(&self, index: c_uint) -> Option<Retained<DOMNode>>;
194
195        /// # Safety
196        ///
197        /// `name` might not allow `None`.
198        #[unsafe(method(namedItem:))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn namedItem(&self, name: Option<&NSString>) -> Option<Retained<DOMNode>>;
201
202        /// # Safety
203        ///
204        /// - `element` might not allow `None`.
205        /// - `before` might not allow `None`.
206        #[unsafe(method(add:before:))]
207        #[unsafe(method_family = none)]
208        pub unsafe fn add_before(
209            &self,
210            element: Option<&DOMHTMLElement>,
211            before: Option<&DOMHTMLElement>,
212        );
213
214        #[deprecated]
215        #[unsafe(method(remove:))]
216        #[unsafe(method_family = none)]
217        pub unsafe fn remove(&self, index: c_int);
218    );
219}
220
221/// Methods declared on superclass `DOMObject`.
222#[cfg(all(
223    feature = "DOMElement",
224    feature = "DOMHTMLElement",
225    feature = "DOMNode",
226    feature = "DOMObject",
227    feature = "WebScriptObject"
228))]
229impl DOMHTMLSelectElement {
230    extern_methods!(
231        #[deprecated]
232        #[unsafe(method(init))]
233        #[unsafe(method_family = init)]
234        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
235    );
236}
237
238/// Methods declared on superclass `NSObject`.
239#[cfg(all(
240    feature = "DOMElement",
241    feature = "DOMHTMLElement",
242    feature = "DOMNode",
243    feature = "DOMObject",
244    feature = "WebScriptObject"
245))]
246impl DOMHTMLSelectElement {
247    extern_methods!(
248        #[unsafe(method(new))]
249        #[unsafe(method_family = new)]
250        pub unsafe fn new() -> Retained<Self>;
251    );
252}
253
254/// DOMHTMLSelectElementDeprecated.
255#[deprecated]
256#[cfg(all(
257    feature = "DOMElement",
258    feature = "DOMHTMLElement",
259    feature = "DOMNode",
260    feature = "DOMObject",
261    feature = "WebScriptObject"
262))]
263impl DOMHTMLSelectElement {
264    extern_methods!(
265        /// # Safety
266        ///
267        /// - `element` might not allow `None`.
268        /// - `before` might not allow `None`.
269        #[deprecated]
270        #[unsafe(method(add::))]
271        #[unsafe(method_family = none)]
272        pub unsafe fn add(&self, element: Option<&DOMHTMLElement>, before: Option<&DOMHTMLElement>);
273    );
274}