objc2_web_kit/generated/
DOMCSSStyleSheet.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/domcssstylesheet?language=objc)
12    #[unsafe(super(DOMStyleSheet, DOMObject, WebScriptObject, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(all(
15        feature = "DOMObject",
16        feature = "DOMStyleSheet",
17        feature = "WebScriptObject"
18    ))]
19    #[deprecated]
20    pub struct DOMCSSStyleSheet;
21);
22
23#[cfg(all(
24    feature = "DOMObject",
25    feature = "DOMStyleSheet",
26    feature = "WebScriptObject"
27))]
28extern_conformance!(
29    unsafe impl NSCopying for DOMCSSStyleSheet {}
30);
31
32#[cfg(all(
33    feature = "DOMObject",
34    feature = "DOMStyleSheet",
35    feature = "WebScriptObject"
36))]
37unsafe impl CopyingHelper for DOMCSSStyleSheet {
38    type Result = Self;
39}
40
41#[cfg(all(
42    feature = "DOMObject",
43    feature = "DOMStyleSheet",
44    feature = "WebScriptObject"
45))]
46extern_conformance!(
47    unsafe impl NSObjectProtocol for DOMCSSStyleSheet {}
48);
49
50#[cfg(all(
51    feature = "DOMObject",
52    feature = "DOMStyleSheet",
53    feature = "WebScriptObject"
54))]
55impl DOMCSSStyleSheet {
56    extern_methods!(
57        #[cfg(feature = "DOMCSSRule")]
58        #[deprecated]
59        #[unsafe(method(ownerRule))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn ownerRule(&self) -> Option<Retained<DOMCSSRule>>;
62
63        #[cfg(feature = "DOMCSSRuleList")]
64        #[deprecated]
65        #[unsafe(method(cssRules))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn cssRules(&self) -> Option<Retained<DOMCSSRuleList>>;
68
69        #[cfg(feature = "DOMCSSRuleList")]
70        #[unsafe(method(rules))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn rules(&self) -> Option<Retained<DOMCSSRuleList>>;
73
74        /// # Safety
75        ///
76        /// `rule` might not allow `None`.
77        #[unsafe(method(insertRule:index:))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn insertRule_index(&self, rule: Option<&NSString>, index: c_uint) -> c_uint;
80
81        #[deprecated]
82        #[unsafe(method(deleteRule:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn deleteRule(&self, index: c_uint);
85
86        /// # Safety
87        ///
88        /// - `selector` might not allow `None`.
89        /// - `style` might not allow `None`.
90        #[unsafe(method(addRule:style:index:))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn addRule_style_index(
93            &self,
94            selector: Option<&NSString>,
95            style: Option<&NSString>,
96            index: c_uint,
97        ) -> c_int;
98
99        #[unsafe(method(removeRule:))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn removeRule(&self, index: c_uint);
102    );
103}
104
105/// Methods declared on superclass `DOMObject`.
106#[cfg(all(
107    feature = "DOMObject",
108    feature = "DOMStyleSheet",
109    feature = "WebScriptObject"
110))]
111impl DOMCSSStyleSheet {
112    extern_methods!(
113        #[deprecated]
114        #[unsafe(method(init))]
115        #[unsafe(method_family = init)]
116        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
117    );
118}
119
120/// Methods declared on superclass `NSObject`.
121#[cfg(all(
122    feature = "DOMObject",
123    feature = "DOMStyleSheet",
124    feature = "WebScriptObject"
125))]
126impl DOMCSSStyleSheet {
127    extern_methods!(
128        #[unsafe(method(new))]
129        #[unsafe(method_family = new)]
130        pub unsafe fn new() -> Retained<Self>;
131    );
132}
133
134/// DOMCSSStyleSheetDeprecated.
135#[deprecated]
136#[cfg(all(
137    feature = "DOMObject",
138    feature = "DOMStyleSheet",
139    feature = "WebScriptObject"
140))]
141impl DOMCSSStyleSheet {
142    extern_methods!(
143        /// # Safety
144        ///
145        /// `rule` might not allow `None`.
146        #[deprecated]
147        #[unsafe(method(insertRule::))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn insertRule(&self, rule: Option<&NSString>, index: c_uint) -> c_uint;
150    );
151}