objc2_foundation/generated/
NSURLHandle.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern "C" {
10 #[cfg(feature = "NSString")]
12 pub static NSHTTPPropertyStatusCodeKey: Option<&'static NSString>;
13}
14
15extern "C" {
16 #[cfg(feature = "NSString")]
18 pub static NSHTTPPropertyStatusReasonKey: Option<&'static NSString>;
19}
20
21extern "C" {
22 #[cfg(feature = "NSString")]
24 pub static NSHTTPPropertyServerHTTPVersionKey: Option<&'static NSString>;
25}
26
27extern "C" {
28 #[cfg(feature = "NSString")]
30 pub static NSHTTPPropertyRedirectionHeadersKey: Option<&'static NSString>;
31}
32
33extern "C" {
34 #[cfg(feature = "NSString")]
36 pub static NSHTTPPropertyErrorPageDataKey: Option<&'static NSString>;
37}
38
39extern "C" {
40 #[cfg(feature = "NSString")]
42 pub static NSHTTPPropertyHTTPProxy: Option<&'static NSString>;
43}
44
45extern "C" {
46 #[cfg(feature = "NSString")]
48 pub static NSFTPPropertyUserLoginKey: Option<&'static NSString>;
49}
50
51extern "C" {
52 #[cfg(feature = "NSString")]
54 pub static NSFTPPropertyUserPasswordKey: Option<&'static NSString>;
55}
56
57extern "C" {
58 #[cfg(feature = "NSString")]
60 pub static NSFTPPropertyActiveTransferModeKey: Option<&'static NSString>;
61}
62
63extern "C" {
64 #[cfg(feature = "NSString")]
66 pub static NSFTPPropertyFileOffsetKey: Option<&'static NSString>;
67}
68
69extern "C" {
70 #[cfg(feature = "NSString")]
72 pub static NSFTPPropertyFTPProxy: Option<&'static NSString>;
73}
74
75#[repr(transparent)]
78#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
79pub struct NSURLHandleStatus(pub NSUInteger);
80impl NSURLHandleStatus {
81 #[doc(alias = "NSURLHandleNotLoaded")]
82 pub const NotLoaded: Self = Self(0);
83 #[doc(alias = "NSURLHandleLoadSucceeded")]
84 pub const LoadSucceeded: Self = Self(1);
85 #[doc(alias = "NSURLHandleLoadInProgress")]
86 pub const LoadInProgress: Self = Self(2);
87 #[doc(alias = "NSURLHandleLoadFailed")]
88 pub const LoadFailed: Self = Self(3);
89}
90
91unsafe impl Encode for NSURLHandleStatus {
92 const ENCODING: Encoding = NSUInteger::ENCODING;
93}
94
95unsafe impl RefEncode for NSURLHandleStatus {
96 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
97}
98
99extern_protocol!(
100 #[deprecated]
102 pub unsafe trait NSURLHandleClient {
103 #[cfg(feature = "NSData")]
104 #[deprecated]
105 #[unsafe(method(URLHandle:resourceDataDidBecomeAvailable:))]
106 #[unsafe(method_family = none)]
107 unsafe fn URLHandle_resourceDataDidBecomeAvailable(
108 &self,
109 sender: Option<&NSURLHandle>,
110 new_bytes: Option<&NSData>,
111 );
112
113 #[deprecated]
114 #[unsafe(method(URLHandleResourceDidBeginLoading:))]
115 #[unsafe(method_family = none)]
116 unsafe fn URLHandleResourceDidBeginLoading(&self, sender: Option<&NSURLHandle>);
117
118 #[deprecated]
119 #[unsafe(method(URLHandleResourceDidFinishLoading:))]
120 #[unsafe(method_family = none)]
121 unsafe fn URLHandleResourceDidFinishLoading(&self, sender: Option<&NSURLHandle>);
122
123 #[deprecated]
124 #[unsafe(method(URLHandleResourceDidCancelLoading:))]
125 #[unsafe(method_family = none)]
126 unsafe fn URLHandleResourceDidCancelLoading(&self, sender: Option<&NSURLHandle>);
127
128 #[cfg(feature = "NSString")]
129 #[deprecated]
130 #[unsafe(method(URLHandle:resourceDidFailLoadingWithReason:))]
131 #[unsafe(method_family = none)]
132 unsafe fn URLHandle_resourceDidFailLoadingWithReason(
133 &self,
134 sender: Option<&NSURLHandle>,
135 reason: Option<&NSString>,
136 );
137 }
138);
139
140extern_class!(
141 #[unsafe(super(NSObject))]
143 #[derive(Debug, PartialEq, Eq, Hash)]
144 pub struct NSURLHandle;
145);
146
147unsafe impl NSObjectProtocol for NSURLHandle {}
148
149impl NSURLHandle {
150 extern_methods!(
151 #[deprecated]
152 #[unsafe(method(registerURLHandleClass:))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn registerURLHandleClass(an_url_handle_subclass: Option<&AnyClass>);
155
156 #[cfg(feature = "NSURL")]
157 #[deprecated]
158 #[unsafe(method(URLHandleClassForURL:))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn URLHandleClassForURL(an_url: Option<&NSURL>) -> Option<&'static AnyClass>;
161
162 #[deprecated]
163 #[unsafe(method(status))]
164 #[unsafe(method_family = none)]
165 pub unsafe fn status(&self) -> NSURLHandleStatus;
166
167 #[cfg(feature = "NSString")]
168 #[deprecated]
169 #[unsafe(method(failureReason))]
170 #[unsafe(method_family = none)]
171 pub unsafe fn failureReason(&self) -> Option<Retained<NSString>>;
172
173 #[deprecated]
174 #[unsafe(method(addClient:))]
175 #[unsafe(method_family = none)]
176 pub unsafe fn addClient(&self, client: Option<&ProtocolObject<dyn NSURLHandleClient>>);
177
178 #[deprecated]
179 #[unsafe(method(removeClient:))]
180 #[unsafe(method_family = none)]
181 pub unsafe fn removeClient(&self, client: Option<&ProtocolObject<dyn NSURLHandleClient>>);
182
183 #[deprecated]
184 #[unsafe(method(loadInBackground))]
185 #[unsafe(method_family = none)]
186 pub unsafe fn loadInBackground(&self);
187
188 #[deprecated]
189 #[unsafe(method(cancelLoadInBackground))]
190 #[unsafe(method_family = none)]
191 pub unsafe fn cancelLoadInBackground(&self);
192
193 #[cfg(feature = "NSData")]
194 #[deprecated]
195 #[unsafe(method(resourceData))]
196 #[unsafe(method_family = none)]
197 pub unsafe fn resourceData(&self) -> Option<Retained<NSData>>;
198
199 #[cfg(feature = "NSData")]
200 #[deprecated]
201 #[unsafe(method(availableResourceData))]
202 #[unsafe(method_family = none)]
203 pub unsafe fn availableResourceData(&self) -> Option<Retained<NSData>>;
204
205 #[deprecated]
206 #[unsafe(method(expectedResourceDataSize))]
207 #[unsafe(method_family = none)]
208 pub unsafe fn expectedResourceDataSize(&self) -> c_longlong;
209
210 #[deprecated]
211 #[unsafe(method(flushCachedData))]
212 #[unsafe(method_family = none)]
213 pub unsafe fn flushCachedData(&self);
214
215 #[cfg(feature = "NSString")]
216 #[deprecated]
217 #[unsafe(method(backgroundLoadDidFailWithReason:))]
218 #[unsafe(method_family = none)]
219 pub unsafe fn backgroundLoadDidFailWithReason(&self, reason: Option<&NSString>);
220
221 #[cfg(feature = "NSData")]
222 #[deprecated]
223 #[unsafe(method(didLoadBytes:loadComplete:))]
224 #[unsafe(method_family = none)]
225 pub unsafe fn didLoadBytes_loadComplete(&self, new_bytes: Option<&NSData>, yorn: bool);
226
227 #[cfg(feature = "NSURL")]
228 #[deprecated]
229 #[unsafe(method(canInitWithURL:))]
230 #[unsafe(method_family = none)]
231 pub unsafe fn canInitWithURL(an_url: Option<&NSURL>) -> bool;
232
233 #[cfg(feature = "NSURL")]
234 #[deprecated]
235 #[unsafe(method(cachedHandleForURL:))]
236 #[unsafe(method_family = none)]
237 pub unsafe fn cachedHandleForURL(an_url: Option<&NSURL>) -> Option<Retained<NSURLHandle>>;
238
239 #[cfg(feature = "NSURL")]
240 #[deprecated]
241 #[unsafe(method(initWithURL:cached:))]
242 #[unsafe(method_family = init)]
243 pub unsafe fn initWithURL_cached(
244 this: Allocated<Self>,
245 an_url: Option<&NSURL>,
246 will_cache: bool,
247 ) -> Option<Retained<Self>>;
248
249 #[cfg(feature = "NSString")]
250 #[deprecated]
251 #[unsafe(method(propertyForKey:))]
252 #[unsafe(method_family = none)]
253 pub unsafe fn propertyForKey(
254 &self,
255 property_key: Option<&NSString>,
256 ) -> Option<Retained<AnyObject>>;
257
258 #[cfg(feature = "NSString")]
259 #[deprecated]
260 #[unsafe(method(propertyForKeyIfAvailable:))]
261 #[unsafe(method_family = none)]
262 pub unsafe fn propertyForKeyIfAvailable(
263 &self,
264 property_key: Option<&NSString>,
265 ) -> Option<Retained<AnyObject>>;
266
267 #[cfg(feature = "NSString")]
268 #[deprecated]
269 #[unsafe(method(writeProperty:forKey:))]
270 #[unsafe(method_family = none)]
271 pub unsafe fn writeProperty_forKey(
272 &self,
273 property_value: Option<&AnyObject>,
274 property_key: Option<&NSString>,
275 ) -> bool;
276
277 #[cfg(feature = "NSData")]
278 #[deprecated]
279 #[unsafe(method(writeData:))]
280 #[unsafe(method_family = none)]
281 pub unsafe fn writeData(&self, data: Option<&NSData>) -> bool;
282
283 #[cfg(feature = "NSData")]
284 #[deprecated]
285 #[unsafe(method(loadInForeground))]
286 #[unsafe(method_family = none)]
287 pub unsafe fn loadInForeground(&self) -> Option<Retained<NSData>>;
288
289 #[deprecated]
290 #[unsafe(method(beginLoadInBackground))]
291 #[unsafe(method_family = none)]
292 pub unsafe fn beginLoadInBackground(&self);
293
294 #[deprecated]
295 #[unsafe(method(endLoadInBackground))]
296 #[unsafe(method_family = none)]
297 pub unsafe fn endLoadInBackground(&self);
298 );
299}
300
301impl NSURLHandle {
303 extern_methods!(
304 #[unsafe(method(init))]
305 #[unsafe(method_family = init)]
306 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
307
308 #[unsafe(method(new))]
309 #[unsafe(method_family = new)]
310 pub unsafe fn new() -> Retained<Self>;
311 );
312}