objc2_web_kit/generated/
DOMCharacterData.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/domcharacterdata?language=objc)
12    #[unsafe(super(DOMNode, DOMObject, WebScriptObject, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(all(
15        feature = "DOMNode",
16        feature = "DOMObject",
17        feature = "WebScriptObject"
18    ))]
19    #[deprecated]
20    pub struct DOMCharacterData;
21);
22
23#[cfg(all(
24    feature = "DOMEventTarget",
25    feature = "DOMNode",
26    feature = "DOMObject",
27    feature = "WebScriptObject"
28))]
29extern_conformance!(
30    unsafe impl DOMEventTarget for DOMCharacterData {}
31);
32
33#[cfg(all(
34    feature = "DOMNode",
35    feature = "DOMObject",
36    feature = "WebScriptObject"
37))]
38extern_conformance!(
39    unsafe impl NSCopying for DOMCharacterData {}
40);
41
42#[cfg(all(
43    feature = "DOMNode",
44    feature = "DOMObject",
45    feature = "WebScriptObject"
46))]
47unsafe impl CopyingHelper for DOMCharacterData {
48    type Result = Self;
49}
50
51#[cfg(all(
52    feature = "DOMNode",
53    feature = "DOMObject",
54    feature = "WebScriptObject"
55))]
56extern_conformance!(
57    unsafe impl NSObjectProtocol for DOMCharacterData {}
58);
59
60#[cfg(all(
61    feature = "DOMNode",
62    feature = "DOMObject",
63    feature = "WebScriptObject"
64))]
65impl DOMCharacterData {
66    extern_methods!(
67        #[deprecated]
68        #[unsafe(method(data))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn data(&self) -> Retained<NSString>;
71
72        /// Setter for [`data`][Self::data].
73        ///
74        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
75        #[deprecated]
76        #[unsafe(method(setData:))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn setData(&self, data: Option<&NSString>);
79
80        #[deprecated]
81        #[unsafe(method(length))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn length(&self) -> c_uint;
84
85        #[unsafe(method(substringData:length:))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn substringData_length(
88            &self,
89            offset: c_uint,
90            length: c_uint,
91        ) -> Option<Retained<NSString>>;
92
93        /// # Safety
94        ///
95        /// `data` might not allow `None`.
96        #[deprecated]
97        #[unsafe(method(appendData:))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn appendData(&self, data: Option<&NSString>);
100
101        /// # Safety
102        ///
103        /// `data` might not allow `None`.
104        #[unsafe(method(insertData:data:))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn insertData_data(&self, offset: c_uint, data: Option<&NSString>);
107
108        #[unsafe(method(deleteData:length:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn deleteData_length(&self, offset: c_uint, length: c_uint);
111
112        /// # Safety
113        ///
114        /// `data` might not allow `None`.
115        #[unsafe(method(replaceData:length:data:))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn replaceData_length_data(
118            &self,
119            offset: c_uint,
120            length: c_uint,
121            data: Option<&NSString>,
122        );
123    );
124}
125
126/// Methods declared on superclass `DOMObject`.
127#[cfg(all(
128    feature = "DOMNode",
129    feature = "DOMObject",
130    feature = "WebScriptObject"
131))]
132impl DOMCharacterData {
133    extern_methods!(
134        #[deprecated]
135        #[unsafe(method(init))]
136        #[unsafe(method_family = init)]
137        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
138    );
139}
140
141/// Methods declared on superclass `NSObject`.
142#[cfg(all(
143    feature = "DOMNode",
144    feature = "DOMObject",
145    feature = "WebScriptObject"
146))]
147impl DOMCharacterData {
148    extern_methods!(
149        #[unsafe(method(new))]
150        #[unsafe(method_family = new)]
151        pub unsafe fn new() -> Retained<Self>;
152    );
153}
154
155/// DOMCharacterDataDeprecated.
156#[deprecated]
157#[cfg(all(
158    feature = "DOMNode",
159    feature = "DOMObject",
160    feature = "WebScriptObject"
161))]
162impl DOMCharacterData {
163    extern_methods!(
164        #[deprecated]
165        #[unsafe(method(substringData::))]
166        #[unsafe(method_family = none)]
167        pub unsafe fn substringData(
168            &self,
169            offset: c_uint,
170            length: c_uint,
171        ) -> Option<Retained<NSString>>;
172
173        /// # Safety
174        ///
175        /// `data` might not allow `None`.
176        #[deprecated]
177        #[unsafe(method(insertData::))]
178        #[unsafe(method_family = none)]
179        pub unsafe fn insertData(&self, offset: c_uint, data: Option<&NSString>);
180
181        #[deprecated]
182        #[unsafe(method(deleteData::))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn deleteData(&self, offset: c_uint, length: c_uint);
185
186        /// # Safety
187        ///
188        /// `data` might not allow `None`.
189        #[deprecated]
190        #[unsafe(method(replaceData:::))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn replaceData(&self, offset: c_uint, length: c_uint, data: Option<&NSString>);
193    );
194}