objc2_web_kit/generated/
DOMHTMLOptionsCollection.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/domhtmloptionscollection?language=objc)
12    #[unsafe(super(DOMObject, WebScriptObject, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
15    #[deprecated]
16    pub struct DOMHTMLOptionsCollection;
17);
18
19#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
20extern_conformance!(
21    unsafe impl NSCopying for DOMHTMLOptionsCollection {}
22);
23
24#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
25unsafe impl CopyingHelper for DOMHTMLOptionsCollection {
26    type Result = Self;
27}
28
29#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
30extern_conformance!(
31    unsafe impl NSObjectProtocol for DOMHTMLOptionsCollection {}
32);
33
34#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
35impl DOMHTMLOptionsCollection {
36    extern_methods!(
37        #[unsafe(method(selectedIndex))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn selectedIndex(&self) -> c_int;
40
41        /// Setter for [`selectedIndex`][Self::selectedIndex].
42        #[unsafe(method(setSelectedIndex:))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn setSelectedIndex(&self, selected_index: c_int);
45
46        #[deprecated]
47        #[unsafe(method(length))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn length(&self) -> c_uint;
50
51        /// Setter for [`length`][Self::length].
52        #[deprecated]
53        #[unsafe(method(setLength:))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn setLength(&self, length: c_uint);
56
57        #[cfg(feature = "DOMNode")]
58        /// # Safety
59        ///
60        /// `name` might not allow `None`.
61        #[deprecated]
62        #[unsafe(method(namedItem:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn namedItem(&self, name: Option<&NSString>) -> Option<Retained<DOMNode>>;
65
66        #[cfg(all(
67            feature = "DOMElement",
68            feature = "DOMHTMLElement",
69            feature = "DOMHTMLOptionElement",
70            feature = "DOMNode"
71        ))]
72        /// # Safety
73        ///
74        /// `option` might not allow `None`.
75        #[unsafe(method(add:index:))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn add_index(&self, option: Option<&DOMHTMLOptionElement>, index: c_uint);
78
79        #[unsafe(method(remove:))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn remove(&self, index: c_uint);
82
83        #[cfg(feature = "DOMNode")]
84        #[deprecated]
85        #[unsafe(method(item:))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn item(&self, index: c_uint) -> Option<Retained<DOMNode>>;
88    );
89}
90
91/// Methods declared on superclass `DOMObject`.
92#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
93impl DOMHTMLOptionsCollection {
94    extern_methods!(
95        #[deprecated]
96        #[unsafe(method(init))]
97        #[unsafe(method_family = init)]
98        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
99    );
100}
101
102/// Methods declared on superclass `NSObject`.
103#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
104impl DOMHTMLOptionsCollection {
105    extern_methods!(
106        #[unsafe(method(new))]
107        #[unsafe(method_family = new)]
108        pub unsafe fn new() -> Retained<Self>;
109    );
110}