objc2_foundation/generated/
NSURL.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8
9use crate::*;
10
11/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlresourcekey?language=objc)
12// NS_TYPED_EXTENSIBLE_ENUM
13#[cfg(feature = "NSString")]
14pub type NSURLResourceKey = NSString;
15
16extern "C" {
17    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfilescheme?language=objc)
18    #[cfg(feature = "NSString")]
19    pub static NSURLFileScheme: &'static NSString;
20}
21
22extern "C" {
23    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlkeysofunsetvalueskey?language=objc)
24    #[cfg(feature = "NSString")]
25    pub static NSURLKeysOfUnsetValuesKey: &'static NSURLResourceKey;
26}
27
28extern "C" {
29    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlnamekey?language=objc)
30    #[cfg(feature = "NSString")]
31    pub static NSURLNameKey: &'static NSURLResourceKey;
32}
33
34extern "C" {
35    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurllocalizednamekey?language=objc)
36    #[cfg(feature = "NSString")]
37    pub static NSURLLocalizedNameKey: &'static NSURLResourceKey;
38}
39
40extern "C" {
41    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlisregularfilekey?language=objc)
42    #[cfg(feature = "NSString")]
43    pub static NSURLIsRegularFileKey: &'static NSURLResourceKey;
44}
45
46extern "C" {
47    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlisdirectorykey?language=objc)
48    #[cfg(feature = "NSString")]
49    pub static NSURLIsDirectoryKey: &'static NSURLResourceKey;
50}
51
52extern "C" {
53    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlissymboliclinkkey?language=objc)
54    #[cfg(feature = "NSString")]
55    pub static NSURLIsSymbolicLinkKey: &'static NSURLResourceKey;
56}
57
58extern "C" {
59    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlisvolumekey?language=objc)
60    #[cfg(feature = "NSString")]
61    pub static NSURLIsVolumeKey: &'static NSURLResourceKey;
62}
63
64extern "C" {
65    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlispackagekey?language=objc)
66    #[cfg(feature = "NSString")]
67    pub static NSURLIsPackageKey: &'static NSURLResourceKey;
68}
69
70extern "C" {
71    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlisapplicationkey?language=objc)
72    #[cfg(feature = "NSString")]
73    pub static NSURLIsApplicationKey: &'static NSURLResourceKey;
74}
75
76extern "C" {
77    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlapplicationisscriptablekey?language=objc)
78    #[cfg(feature = "NSString")]
79    pub static NSURLApplicationIsScriptableKey: &'static NSURLResourceKey;
80}
81
82extern "C" {
83    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlissystemimmutablekey?language=objc)
84    #[cfg(feature = "NSString")]
85    pub static NSURLIsSystemImmutableKey: &'static NSURLResourceKey;
86}
87
88extern "C" {
89    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlisuserimmutablekey?language=objc)
90    #[cfg(feature = "NSString")]
91    pub static NSURLIsUserImmutableKey: &'static NSURLResourceKey;
92}
93
94extern "C" {
95    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlishiddenkey?language=objc)
96    #[cfg(feature = "NSString")]
97    pub static NSURLIsHiddenKey: &'static NSURLResourceKey;
98}
99
100extern "C" {
101    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlhashiddenextensionkey?language=objc)
102    #[cfg(feature = "NSString")]
103    pub static NSURLHasHiddenExtensionKey: &'static NSURLResourceKey;
104}
105
106extern "C" {
107    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlcreationdatekey?language=objc)
108    #[cfg(feature = "NSString")]
109    pub static NSURLCreationDateKey: &'static NSURLResourceKey;
110}
111
112extern "C" {
113    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlcontentaccessdatekey?language=objc)
114    #[cfg(feature = "NSString")]
115    pub static NSURLContentAccessDateKey: &'static NSURLResourceKey;
116}
117
118extern "C" {
119    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlcontentmodificationdatekey?language=objc)
120    #[cfg(feature = "NSString")]
121    pub static NSURLContentModificationDateKey: &'static NSURLResourceKey;
122}
123
124extern "C" {
125    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlattributemodificationdatekey?language=objc)
126    #[cfg(feature = "NSString")]
127    pub static NSURLAttributeModificationDateKey: &'static NSURLResourceKey;
128}
129
130extern "C" {
131    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurllinkcountkey?language=objc)
132    #[cfg(feature = "NSString")]
133    pub static NSURLLinkCountKey: &'static NSURLResourceKey;
134}
135
136extern "C" {
137    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlparentdirectoryurlkey?language=objc)
138    #[cfg(feature = "NSString")]
139    pub static NSURLParentDirectoryURLKey: &'static NSURLResourceKey;
140}
141
142extern "C" {
143    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumeurlkey?language=objc)
144    #[cfg(feature = "NSString")]
145    pub static NSURLVolumeURLKey: &'static NSURLResourceKey;
146}
147
148extern "C" {
149    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurltypeidentifierkey?language=objc)
150    #[cfg(feature = "NSString")]
151    #[deprecated = "Use NSURLContentTypeKey instead"]
152    pub static NSURLTypeIdentifierKey: &'static NSURLResourceKey;
153}
154
155extern "C" {
156    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlcontenttypekey?language=objc)
157    #[cfg(feature = "NSString")]
158    pub static NSURLContentTypeKey: &'static NSURLResourceKey;
159}
160
161extern "C" {
162    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurllocalizedtypedescriptionkey?language=objc)
163    #[cfg(feature = "NSString")]
164    pub static NSURLLocalizedTypeDescriptionKey: &'static NSURLResourceKey;
165}
166
167extern "C" {
168    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurllabelnumberkey?language=objc)
169    #[cfg(feature = "NSString")]
170    pub static NSURLLabelNumberKey: &'static NSURLResourceKey;
171}
172
173extern "C" {
174    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurllabelcolorkey?language=objc)
175    #[cfg(feature = "NSString")]
176    pub static NSURLLabelColorKey: &'static NSURLResourceKey;
177}
178
179extern "C" {
180    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurllocalizedlabelkey?language=objc)
181    #[cfg(feature = "NSString")]
182    pub static NSURLLocalizedLabelKey: &'static NSURLResourceKey;
183}
184
185extern "C" {
186    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurleffectiveiconkey?language=objc)
187    #[cfg(feature = "NSString")]
188    pub static NSURLEffectiveIconKey: &'static NSURLResourceKey;
189}
190
191extern "C" {
192    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlcustomiconkey?language=objc)
193    #[cfg(feature = "NSString")]
194    pub static NSURLCustomIconKey: &'static NSURLResourceKey;
195}
196
197extern "C" {
198    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileresourceidentifierkey?language=objc)
199    #[cfg(feature = "NSString")]
200    pub static NSURLFileResourceIdentifierKey: &'static NSURLResourceKey;
201}
202
203extern "C" {
204    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumeidentifierkey?language=objc)
205    #[cfg(feature = "NSString")]
206    pub static NSURLVolumeIdentifierKey: &'static NSURLResourceKey;
207}
208
209extern "C" {
210    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlpreferredioblocksizekey?language=objc)
211    #[cfg(feature = "NSString")]
212    pub static NSURLPreferredIOBlockSizeKey: &'static NSURLResourceKey;
213}
214
215extern "C" {
216    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlisreadablekey?language=objc)
217    #[cfg(feature = "NSString")]
218    pub static NSURLIsReadableKey: &'static NSURLResourceKey;
219}
220
221extern "C" {
222    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurliswritablekey?language=objc)
223    #[cfg(feature = "NSString")]
224    pub static NSURLIsWritableKey: &'static NSURLResourceKey;
225}
226
227extern "C" {
228    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlisexecutablekey?language=objc)
229    #[cfg(feature = "NSString")]
230    pub static NSURLIsExecutableKey: &'static NSURLResourceKey;
231}
232
233extern "C" {
234    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfilesecuritykey?language=objc)
235    #[cfg(feature = "NSString")]
236    pub static NSURLFileSecurityKey: &'static NSURLResourceKey;
237}
238
239extern "C" {
240    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlisexcludedfrombackupkey?language=objc)
241    #[cfg(feature = "NSString")]
242    pub static NSURLIsExcludedFromBackupKey: &'static NSURLResourceKey;
243}
244
245extern "C" {
246    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurltagnameskey?language=objc)
247    #[cfg(feature = "NSString")]
248    pub static NSURLTagNamesKey: &'static NSURLResourceKey;
249}
250
251extern "C" {
252    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlpathkey?language=objc)
253    #[cfg(feature = "NSString")]
254    pub static NSURLPathKey: &'static NSURLResourceKey;
255}
256
257extern "C" {
258    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlcanonicalpathkey?language=objc)
259    #[cfg(feature = "NSString")]
260    pub static NSURLCanonicalPathKey: &'static NSURLResourceKey;
261}
262
263extern "C" {
264    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlismounttriggerkey?language=objc)
265    #[cfg(feature = "NSString")]
266    pub static NSURLIsMountTriggerKey: &'static NSURLResourceKey;
267}
268
269extern "C" {
270    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlgenerationidentifierkey?language=objc)
271    #[cfg(feature = "NSString")]
272    pub static NSURLGenerationIdentifierKey: &'static NSURLResourceKey;
273}
274
275extern "C" {
276    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurldocumentidentifierkey?language=objc)
277    #[cfg(feature = "NSString")]
278    pub static NSURLDocumentIdentifierKey: &'static NSURLResourceKey;
279}
280
281extern "C" {
282    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurladdedtodirectorydatekey?language=objc)
283    #[cfg(feature = "NSString")]
284    pub static NSURLAddedToDirectoryDateKey: &'static NSURLResourceKey;
285}
286
287extern "C" {
288    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlquarantinepropertieskey?language=objc)
289    #[cfg(feature = "NSString")]
290    pub static NSURLQuarantinePropertiesKey: &'static NSURLResourceKey;
291}
292
293extern "C" {
294    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileresourcetypekey?language=objc)
295    #[cfg(feature = "NSString")]
296    pub static NSURLFileResourceTypeKey: &'static NSURLResourceKey;
297}
298
299extern "C" {
300    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileidentifierkey?language=objc)
301    #[cfg(feature = "NSString")]
302    pub static NSURLFileIdentifierKey: &'static NSURLResourceKey;
303}
304
305extern "C" {
306    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfilecontentidentifierkey?language=objc)
307    #[cfg(feature = "NSString")]
308    pub static NSURLFileContentIdentifierKey: &'static NSURLResourceKey;
309}
310
311extern "C" {
312    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlmaysharefilecontentkey?language=objc)
313    #[cfg(feature = "NSString")]
314    pub static NSURLMayShareFileContentKey: &'static NSURLResourceKey;
315}
316
317extern "C" {
318    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlmayhaveextendedattributeskey?language=objc)
319    #[cfg(feature = "NSString")]
320    pub static NSURLMayHaveExtendedAttributesKey: &'static NSURLResourceKey;
321}
322
323extern "C" {
324    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlispurgeablekey?language=objc)
325    #[cfg(feature = "NSString")]
326    pub static NSURLIsPurgeableKey: &'static NSURLResourceKey;
327}
328
329extern "C" {
330    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlissparsekey?language=objc)
331    #[cfg(feature = "NSString")]
332    pub static NSURLIsSparseKey: &'static NSURLResourceKey;
333}
334
335/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileresourcetype?language=objc)
336// NS_TYPED_ENUM
337#[cfg(feature = "NSString")]
338pub type NSURLFileResourceType = NSString;
339
340extern "C" {
341    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileresourcetypenamedpipe?language=objc)
342    #[cfg(feature = "NSString")]
343    pub static NSURLFileResourceTypeNamedPipe: &'static NSURLFileResourceType;
344}
345
346extern "C" {
347    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileresourcetypecharacterspecial?language=objc)
348    #[cfg(feature = "NSString")]
349    pub static NSURLFileResourceTypeCharacterSpecial: &'static NSURLFileResourceType;
350}
351
352extern "C" {
353    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileresourcetypedirectory?language=objc)
354    #[cfg(feature = "NSString")]
355    pub static NSURLFileResourceTypeDirectory: &'static NSURLFileResourceType;
356}
357
358extern "C" {
359    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileresourcetypeblockspecial?language=objc)
360    #[cfg(feature = "NSString")]
361    pub static NSURLFileResourceTypeBlockSpecial: &'static NSURLFileResourceType;
362}
363
364extern "C" {
365    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileresourcetyperegular?language=objc)
366    #[cfg(feature = "NSString")]
367    pub static NSURLFileResourceTypeRegular: &'static NSURLFileResourceType;
368}
369
370extern "C" {
371    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileresourcetypesymboliclink?language=objc)
372    #[cfg(feature = "NSString")]
373    pub static NSURLFileResourceTypeSymbolicLink: &'static NSURLFileResourceType;
374}
375
376extern "C" {
377    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileresourcetypesocket?language=objc)
378    #[cfg(feature = "NSString")]
379    pub static NSURLFileResourceTypeSocket: &'static NSURLFileResourceType;
380}
381
382extern "C" {
383    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileresourcetypeunknown?language=objc)
384    #[cfg(feature = "NSString")]
385    pub static NSURLFileResourceTypeUnknown: &'static NSURLFileResourceType;
386}
387
388extern "C" {
389    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlthumbnaildictionarykey?language=objc)
390    #[cfg(feature = "NSString")]
391    #[deprecated = "Use the QuickLookThumbnailing framework and extension point instead"]
392    pub static NSURLThumbnailDictionaryKey: &'static NSURLResourceKey;
393}
394
395extern "C" {
396    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlthumbnailkey?language=objc)
397    #[cfg(feature = "NSString")]
398    #[deprecated = "Use the QuickLookThumbnailing framework and extension point instead"]
399    pub static NSURLThumbnailKey: &'static NSURLResourceKey;
400}
401
402/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlthumbnaildictionaryitem?language=objc)
403// NS_TYPED_EXTENSIBLE_ENUM
404#[cfg(feature = "NSString")]
405pub type NSURLThumbnailDictionaryItem = NSString;
406
407extern "C" {
408    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsthumbnail1024x1024sizekey?language=objc)
409    #[cfg(feature = "NSString")]
410    #[deprecated = "Use the QuickLookThumbnailing framework and extension point instead"]
411    pub static NSThumbnail1024x1024SizeKey: &'static NSURLThumbnailDictionaryItem;
412}
413
414extern "C" {
415    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfilesizekey?language=objc)
416    #[cfg(feature = "NSString")]
417    pub static NSURLFileSizeKey: &'static NSURLResourceKey;
418}
419
420extern "C" {
421    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileallocatedsizekey?language=objc)
422    #[cfg(feature = "NSString")]
423    pub static NSURLFileAllocatedSizeKey: &'static NSURLResourceKey;
424}
425
426extern "C" {
427    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurltotalfilesizekey?language=objc)
428    #[cfg(feature = "NSString")]
429    pub static NSURLTotalFileSizeKey: &'static NSURLResourceKey;
430}
431
432extern "C" {
433    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurltotalfileallocatedsizekey?language=objc)
434    #[cfg(feature = "NSString")]
435    pub static NSURLTotalFileAllocatedSizeKey: &'static NSURLResourceKey;
436}
437
438extern "C" {
439    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlisaliasfilekey?language=objc)
440    #[cfg(feature = "NSString")]
441    pub static NSURLIsAliasFileKey: &'static NSURLResourceKey;
442}
443
444extern "C" {
445    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileprotectionkey?language=objc)
446    #[cfg(feature = "NSString")]
447    pub static NSURLFileProtectionKey: &'static NSURLResourceKey;
448}
449
450/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileprotectiontype?language=objc)
451// NS_TYPED_ENUM
452#[cfg(feature = "NSString")]
453pub type NSURLFileProtectionType = NSString;
454
455extern "C" {
456    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileprotectionnone?language=objc)
457    #[cfg(feature = "NSString")]
458    pub static NSURLFileProtectionNone: &'static NSURLFileProtectionType;
459}
460
461extern "C" {
462    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileprotectioncomplete?language=objc)
463    #[cfg(feature = "NSString")]
464    pub static NSURLFileProtectionComplete: &'static NSURLFileProtectionType;
465}
466
467extern "C" {
468    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileprotectioncompleteunlessopen?language=objc)
469    #[cfg(feature = "NSString")]
470    pub static NSURLFileProtectionCompleteUnlessOpen: &'static NSURLFileProtectionType;
471}
472
473extern "C" {
474    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileprotectioncompleteuntilfirstuserauthentication?language=objc)
475    #[cfg(feature = "NSString")]
476    pub static NSURLFileProtectionCompleteUntilFirstUserAuthentication:
477        &'static NSURLFileProtectionType;
478}
479
480extern "C" {
481    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlfileprotectioncompletewhenuserinactive?language=objc)
482    #[cfg(feature = "NSString")]
483    pub static NSURLFileProtectionCompleteWhenUserInactive: &'static NSURLFileProtectionType;
484}
485
486extern "C" {
487    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurldirectoryentrycountkey?language=objc)
488    #[cfg(feature = "NSString")]
489    pub static NSURLDirectoryEntryCountKey: &'static NSURLResourceKey;
490}
491
492extern "C" {
493    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumelocalizedformatdescriptionkey?language=objc)
494    #[cfg(feature = "NSString")]
495    pub static NSURLVolumeLocalizedFormatDescriptionKey: &'static NSURLResourceKey;
496}
497
498extern "C" {
499    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumetotalcapacitykey?language=objc)
500    #[cfg(feature = "NSString")]
501    pub static NSURLVolumeTotalCapacityKey: &'static NSURLResourceKey;
502}
503
504extern "C" {
505    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumeavailablecapacitykey?language=objc)
506    #[cfg(feature = "NSString")]
507    pub static NSURLVolumeAvailableCapacityKey: &'static NSURLResourceKey;
508}
509
510extern "C" {
511    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumeresourcecountkey?language=objc)
512    #[cfg(feature = "NSString")]
513    pub static NSURLVolumeResourceCountKey: &'static NSURLResourceKey;
514}
515
516extern "C" {
517    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportspersistentidskey?language=objc)
518    #[cfg(feature = "NSString")]
519    pub static NSURLVolumeSupportsPersistentIDsKey: &'static NSURLResourceKey;
520}
521
522extern "C" {
523    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportssymboliclinkskey?language=objc)
524    #[cfg(feature = "NSString")]
525    pub static NSURLVolumeSupportsSymbolicLinksKey: &'static NSURLResourceKey;
526}
527
528extern "C" {
529    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportshardlinkskey?language=objc)
530    #[cfg(feature = "NSString")]
531    pub static NSURLVolumeSupportsHardLinksKey: &'static NSURLResourceKey;
532}
533
534extern "C" {
535    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportsjournalingkey?language=objc)
536    #[cfg(feature = "NSString")]
537    pub static NSURLVolumeSupportsJournalingKey: &'static NSURLResourceKey;
538}
539
540extern "C" {
541    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumeisjournalingkey?language=objc)
542    #[cfg(feature = "NSString")]
543    pub static NSURLVolumeIsJournalingKey: &'static NSURLResourceKey;
544}
545
546extern "C" {
547    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportssparsefileskey?language=objc)
548    #[cfg(feature = "NSString")]
549    pub static NSURLVolumeSupportsSparseFilesKey: &'static NSURLResourceKey;
550}
551
552extern "C" {
553    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportszerorunskey?language=objc)
554    #[cfg(feature = "NSString")]
555    pub static NSURLVolumeSupportsZeroRunsKey: &'static NSURLResourceKey;
556}
557
558extern "C" {
559    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportscasesensitivenameskey?language=objc)
560    #[cfg(feature = "NSString")]
561    pub static NSURLVolumeSupportsCaseSensitiveNamesKey: &'static NSURLResourceKey;
562}
563
564extern "C" {
565    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportscasepreservednameskey?language=objc)
566    #[cfg(feature = "NSString")]
567    pub static NSURLVolumeSupportsCasePreservedNamesKey: &'static NSURLResourceKey;
568}
569
570extern "C" {
571    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportsrootdirectorydateskey?language=objc)
572    #[cfg(feature = "NSString")]
573    pub static NSURLVolumeSupportsRootDirectoryDatesKey: &'static NSURLResourceKey;
574}
575
576extern "C" {
577    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportsvolumesizeskey?language=objc)
578    #[cfg(feature = "NSString")]
579    pub static NSURLVolumeSupportsVolumeSizesKey: &'static NSURLResourceKey;
580}
581
582extern "C" {
583    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportsrenamingkey?language=objc)
584    #[cfg(feature = "NSString")]
585    pub static NSURLVolumeSupportsRenamingKey: &'static NSURLResourceKey;
586}
587
588extern "C" {
589    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportsadvisoryfilelockingkey?language=objc)
590    #[cfg(feature = "NSString")]
591    pub static NSURLVolumeSupportsAdvisoryFileLockingKey: &'static NSURLResourceKey;
592}
593
594extern "C" {
595    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportsextendedsecuritykey?language=objc)
596    #[cfg(feature = "NSString")]
597    pub static NSURLVolumeSupportsExtendedSecurityKey: &'static NSURLResourceKey;
598}
599
600extern "C" {
601    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumeisbrowsablekey?language=objc)
602    #[cfg(feature = "NSString")]
603    pub static NSURLVolumeIsBrowsableKey: &'static NSURLResourceKey;
604}
605
606extern "C" {
607    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumemaximumfilesizekey?language=objc)
608    #[cfg(feature = "NSString")]
609    pub static NSURLVolumeMaximumFileSizeKey: &'static NSURLResourceKey;
610}
611
612extern "C" {
613    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumeisejectablekey?language=objc)
614    #[cfg(feature = "NSString")]
615    pub static NSURLVolumeIsEjectableKey: &'static NSURLResourceKey;
616}
617
618extern "C" {
619    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumeisremovablekey?language=objc)
620    #[cfg(feature = "NSString")]
621    pub static NSURLVolumeIsRemovableKey: &'static NSURLResourceKey;
622}
623
624extern "C" {
625    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumeisinternalkey?language=objc)
626    #[cfg(feature = "NSString")]
627    pub static NSURLVolumeIsInternalKey: &'static NSURLResourceKey;
628}
629
630extern "C" {
631    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumeisautomountedkey?language=objc)
632    #[cfg(feature = "NSString")]
633    pub static NSURLVolumeIsAutomountedKey: &'static NSURLResourceKey;
634}
635
636extern "C" {
637    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumeislocalkey?language=objc)
638    #[cfg(feature = "NSString")]
639    pub static NSURLVolumeIsLocalKey: &'static NSURLResourceKey;
640}
641
642extern "C" {
643    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumeisreadonlykey?language=objc)
644    #[cfg(feature = "NSString")]
645    pub static NSURLVolumeIsReadOnlyKey: &'static NSURLResourceKey;
646}
647
648extern "C" {
649    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumecreationdatekey?language=objc)
650    #[cfg(feature = "NSString")]
651    pub static NSURLVolumeCreationDateKey: &'static NSURLResourceKey;
652}
653
654extern "C" {
655    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumeurlforremountingkey?language=objc)
656    #[cfg(feature = "NSString")]
657    pub static NSURLVolumeURLForRemountingKey: &'static NSURLResourceKey;
658}
659
660extern "C" {
661    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumeuuidstringkey?language=objc)
662    #[cfg(feature = "NSString")]
663    pub static NSURLVolumeUUIDStringKey: &'static NSURLResourceKey;
664}
665
666extern "C" {
667    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumenamekey?language=objc)
668    #[cfg(feature = "NSString")]
669    pub static NSURLVolumeNameKey: &'static NSURLResourceKey;
670}
671
672extern "C" {
673    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumelocalizednamekey?language=objc)
674    #[cfg(feature = "NSString")]
675    pub static NSURLVolumeLocalizedNameKey: &'static NSURLResourceKey;
676}
677
678extern "C" {
679    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumeisencryptedkey?language=objc)
680    #[cfg(feature = "NSString")]
681    pub static NSURLVolumeIsEncryptedKey: &'static NSURLResourceKey;
682}
683
684extern "C" {
685    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumeisrootfilesystemkey?language=objc)
686    #[cfg(feature = "NSString")]
687    pub static NSURLVolumeIsRootFileSystemKey: &'static NSURLResourceKey;
688}
689
690extern "C" {
691    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportscompressionkey?language=objc)
692    #[cfg(feature = "NSString")]
693    pub static NSURLVolumeSupportsCompressionKey: &'static NSURLResourceKey;
694}
695
696extern "C" {
697    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportsfilecloningkey?language=objc)
698    #[cfg(feature = "NSString")]
699    pub static NSURLVolumeSupportsFileCloningKey: &'static NSURLResourceKey;
700}
701
702extern "C" {
703    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportsswaprenamingkey?language=objc)
704    #[cfg(feature = "NSString")]
705    pub static NSURLVolumeSupportsSwapRenamingKey: &'static NSURLResourceKey;
706}
707
708extern "C" {
709    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportsexclusiverenamingkey?language=objc)
710    #[cfg(feature = "NSString")]
711    pub static NSURLVolumeSupportsExclusiveRenamingKey: &'static NSURLResourceKey;
712}
713
714extern "C" {
715    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportsimmutablefileskey?language=objc)
716    #[cfg(feature = "NSString")]
717    pub static NSURLVolumeSupportsImmutableFilesKey: &'static NSURLResourceKey;
718}
719
720extern "C" {
721    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportsaccesspermissionskey?language=objc)
722    #[cfg(feature = "NSString")]
723    pub static NSURLVolumeSupportsAccessPermissionsKey: &'static NSURLResourceKey;
724}
725
726extern "C" {
727    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesupportsfileprotectionkey?language=objc)
728    #[cfg(feature = "NSString")]
729    pub static NSURLVolumeSupportsFileProtectionKey: &'static NSURLResourceKey;
730}
731
732extern "C" {
733    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumeavailablecapacityforimportantusagekey?language=objc)
734    #[cfg(feature = "NSString")]
735    pub static NSURLVolumeAvailableCapacityForImportantUsageKey: &'static NSURLResourceKey;
736}
737
738extern "C" {
739    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumeavailablecapacityforopportunisticusagekey?language=objc)
740    #[cfg(feature = "NSString")]
741    pub static NSURLVolumeAvailableCapacityForOpportunisticUsageKey: &'static NSURLResourceKey;
742}
743
744extern "C" {
745    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumetypenamekey?language=objc)
746    #[cfg(feature = "NSString")]
747    pub static NSURLVolumeTypeNameKey: &'static NSURLResourceKey;
748}
749
750extern "C" {
751    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumesubtypekey?language=objc)
752    #[cfg(feature = "NSString")]
753    pub static NSURLVolumeSubtypeKey: &'static NSURLResourceKey;
754}
755
756extern "C" {
757    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlvolumemountfromlocationkey?language=objc)
758    #[cfg(feature = "NSString")]
759    pub static NSURLVolumeMountFromLocationKey: &'static NSURLResourceKey;
760}
761
762extern "C" {
763    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlisubiquitousitemkey?language=objc)
764    #[cfg(feature = "NSString")]
765    pub static NSURLIsUbiquitousItemKey: &'static NSURLResourceKey;
766}
767
768extern "C" {
769    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitemhasunresolvedconflictskey?language=objc)
770    #[cfg(feature = "NSString")]
771    pub static NSURLUbiquitousItemHasUnresolvedConflictsKey: &'static NSURLResourceKey;
772}
773
774extern "C" {
775    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitemisdownloadedkey?language=objc)
776    #[cfg(feature = "NSString")]
777    #[deprecated = "Use NSURLUbiquitousItemDownloadingStatusKey instead"]
778    pub static NSURLUbiquitousItemIsDownloadedKey: &'static NSURLResourceKey;
779}
780
781extern "C" {
782    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitemisdownloadingkey?language=objc)
783    #[cfg(feature = "NSString")]
784    pub static NSURLUbiquitousItemIsDownloadingKey: &'static NSURLResourceKey;
785}
786
787extern "C" {
788    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitemisuploadedkey?language=objc)
789    #[cfg(feature = "NSString")]
790    pub static NSURLUbiquitousItemIsUploadedKey: &'static NSURLResourceKey;
791}
792
793extern "C" {
794    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitemisuploadingkey?language=objc)
795    #[cfg(feature = "NSString")]
796    pub static NSURLUbiquitousItemIsUploadingKey: &'static NSURLResourceKey;
797}
798
799extern "C" {
800    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitempercentdownloadedkey?language=objc)
801    #[cfg(feature = "NSString")]
802    #[deprecated = "Use NSMetadataUbiquitousItemPercentDownloadedKey instead"]
803    pub static NSURLUbiquitousItemPercentDownloadedKey: &'static NSURLResourceKey;
804}
805
806extern "C" {
807    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitempercentuploadedkey?language=objc)
808    #[cfg(feature = "NSString")]
809    #[deprecated = "Use NSMetadataUbiquitousItemPercentUploadedKey instead"]
810    pub static NSURLUbiquitousItemPercentUploadedKey: &'static NSURLResourceKey;
811}
812
813extern "C" {
814    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitemdownloadingstatuskey?language=objc)
815    #[cfg(feature = "NSString")]
816    pub static NSURLUbiquitousItemDownloadingStatusKey: &'static NSURLResourceKey;
817}
818
819extern "C" {
820    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitemdownloadingerrorkey?language=objc)
821    #[cfg(feature = "NSString")]
822    pub static NSURLUbiquitousItemDownloadingErrorKey: &'static NSURLResourceKey;
823}
824
825extern "C" {
826    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitemuploadingerrorkey?language=objc)
827    #[cfg(feature = "NSString")]
828    pub static NSURLUbiquitousItemUploadingErrorKey: &'static NSURLResourceKey;
829}
830
831extern "C" {
832    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitemdownloadrequestedkey?language=objc)
833    #[cfg(feature = "NSString")]
834    pub static NSURLUbiquitousItemDownloadRequestedKey: &'static NSURLResourceKey;
835}
836
837extern "C" {
838    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitemcontainerdisplaynamekey?language=objc)
839    #[cfg(feature = "NSString")]
840    pub static NSURLUbiquitousItemContainerDisplayNameKey: &'static NSURLResourceKey;
841}
842
843extern "C" {
844    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitemisexcludedfromsynckey?language=objc)
845    #[cfg(feature = "NSString")]
846    pub static NSURLUbiquitousItemIsExcludedFromSyncKey: &'static NSURLResourceKey;
847}
848
849extern "C" {
850    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitemissharedkey?language=objc)
851    #[cfg(feature = "NSString")]
852    pub static NSURLUbiquitousItemIsSharedKey: &'static NSURLResourceKey;
853}
854
855extern "C" {
856    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousshareditemcurrentuserrolekey?language=objc)
857    #[cfg(feature = "NSString")]
858    pub static NSURLUbiquitousSharedItemCurrentUserRoleKey: &'static NSURLResourceKey;
859}
860
861extern "C" {
862    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousshareditemcurrentuserpermissionskey?language=objc)
863    #[cfg(feature = "NSString")]
864    pub static NSURLUbiquitousSharedItemCurrentUserPermissionsKey: &'static NSURLResourceKey;
865}
866
867extern "C" {
868    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousshareditemownernamecomponentskey?language=objc)
869    #[cfg(feature = "NSString")]
870    pub static NSURLUbiquitousSharedItemOwnerNameComponentsKey: &'static NSURLResourceKey;
871}
872
873extern "C" {
874    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousshareditemmostrecenteditornamecomponentskey?language=objc)
875    #[cfg(feature = "NSString")]
876    pub static NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey:
877        &'static NSURLResourceKey;
878}
879
880/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitemdownloadingstatus?language=objc)
881// NS_TYPED_ENUM
882#[cfg(feature = "NSString")]
883pub type NSURLUbiquitousItemDownloadingStatus = NSString;
884
885extern "C" {
886    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitemdownloadingstatusnotdownloaded?language=objc)
887    #[cfg(feature = "NSString")]
888    pub static NSURLUbiquitousItemDownloadingStatusNotDownloaded:
889        &'static NSURLUbiquitousItemDownloadingStatus;
890}
891
892extern "C" {
893    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitemdownloadingstatusdownloaded?language=objc)
894    #[cfg(feature = "NSString")]
895    pub static NSURLUbiquitousItemDownloadingStatusDownloaded:
896        &'static NSURLUbiquitousItemDownloadingStatus;
897}
898
899extern "C" {
900    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitemdownloadingstatuscurrent?language=objc)
901    #[cfg(feature = "NSString")]
902    pub static NSURLUbiquitousItemDownloadingStatusCurrent:
903        &'static NSURLUbiquitousItemDownloadingStatus;
904}
905
906/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousshareditemrole?language=objc)
907// NS_TYPED_ENUM
908#[cfg(feature = "NSString")]
909pub type NSURLUbiquitousSharedItemRole = NSString;
910
911extern "C" {
912    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousshareditemroleowner?language=objc)
913    #[cfg(feature = "NSString")]
914    pub static NSURLUbiquitousSharedItemRoleOwner: &'static NSURLUbiquitousSharedItemRole;
915}
916
917extern "C" {
918    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousshareditemroleparticipant?language=objc)
919    #[cfg(feature = "NSString")]
920    pub static NSURLUbiquitousSharedItemRoleParticipant: &'static NSURLUbiquitousSharedItemRole;
921}
922
923/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousshareditempermissions?language=objc)
924// NS_TYPED_ENUM
925#[cfg(feature = "NSString")]
926pub type NSURLUbiquitousSharedItemPermissions = NSString;
927
928extern "C" {
929    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousshareditempermissionsreadonly?language=objc)
930    #[cfg(feature = "NSString")]
931    pub static NSURLUbiquitousSharedItemPermissionsReadOnly:
932        &'static NSURLUbiquitousSharedItemPermissions;
933}
934
935extern "C" {
936    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousshareditempermissionsreadwrite?language=objc)
937    #[cfg(feature = "NSString")]
938    pub static NSURLUbiquitousSharedItemPermissionsReadWrite:
939        &'static NSURLUbiquitousSharedItemPermissions;
940}
941
942extern "C" {
943    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitemsupportedsynccontrolskey?language=objc)
944    #[cfg(feature = "NSString")]
945    pub static NSURLUbiquitousItemSupportedSyncControlsKey: &'static NSURLResourceKey;
946}
947
948extern "C" {
949    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlubiquitousitemissyncpausedkey?language=objc)
950    #[cfg(feature = "NSString")]
951    pub static NSURLUbiquitousItemIsSyncPausedKey: &'static NSURLResourceKey;
952}
953
954/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlbookmarkcreationoptions?language=objc)
955// NS_OPTIONS
956#[repr(transparent)]
957#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
958pub struct NSURLBookmarkCreationOptions(pub NSUInteger);
959bitflags::bitflags! {
960    impl NSURLBookmarkCreationOptions: NSUInteger {
961        #[doc(alias = "NSURLBookmarkCreationPreferFileIDResolution")]
962#[deprecated = "Not supported"]
963        const PreferFileIDResolution = 1<<8;
964        #[doc(alias = "NSURLBookmarkCreationMinimalBookmark")]
965        const MinimalBookmark = 1<<9;
966        #[doc(alias = "NSURLBookmarkCreationSuitableForBookmarkFile")]
967        const SuitableForBookmarkFile = 1<<10;
968        #[doc(alias = "NSURLBookmarkCreationWithSecurityScope")]
969        const WithSecurityScope = 1<<11;
970        #[doc(alias = "NSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess")]
971        const SecurityScopeAllowOnlyReadAccess = 1<<12;
972        #[doc(alias = "NSURLBookmarkCreationWithoutImplicitSecurityScope")]
973        const WithoutImplicitSecurityScope = 1<<29;
974    }
975}
976
977unsafe impl Encode for NSURLBookmarkCreationOptions {
978    const ENCODING: Encoding = NSUInteger::ENCODING;
979}
980
981unsafe impl RefEncode for NSURLBookmarkCreationOptions {
982    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
983}
984
985/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlbookmarkresolutionoptions?language=objc)
986// NS_OPTIONS
987#[repr(transparent)]
988#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
989pub struct NSURLBookmarkResolutionOptions(pub NSUInteger);
990bitflags::bitflags! {
991    impl NSURLBookmarkResolutionOptions: NSUInteger {
992        #[doc(alias = "NSURLBookmarkResolutionWithoutUI")]
993        const WithoutUI = 1<<8;
994        #[doc(alias = "NSURLBookmarkResolutionWithoutMounting")]
995        const WithoutMounting = 1<<9;
996        #[doc(alias = "NSURLBookmarkResolutionWithSecurityScope")]
997        const WithSecurityScope = 1<<10;
998        #[doc(alias = "NSURLBookmarkResolutionWithoutImplicitStartAccessing")]
999        const WithoutImplicitStartAccessing = 1<<15;
1000    }
1001}
1002
1003unsafe impl Encode for NSURLBookmarkResolutionOptions {
1004    const ENCODING: Encoding = NSUInteger::ENCODING;
1005}
1006
1007unsafe impl RefEncode for NSURLBookmarkResolutionOptions {
1008    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1009}
1010
1011/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlbookmarkfilecreationoptions?language=objc)
1012pub type NSURLBookmarkFileCreationOptions = NSUInteger;
1013
1014extern_class!(
1015    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurl?language=objc)
1016    #[unsafe(super(NSObject))]
1017    #[derive(Debug, PartialEq, Eq, Hash)]
1018    pub struct NSURL;
1019);
1020
1021unsafe impl Send for NSURL {}
1022
1023unsafe impl Sync for NSURL {}
1024
1025#[cfg(feature = "objc2-core-foundation")]
1026impl AsRef<NSURL> for CFURL {
1027    #[inline]
1028    fn as_ref(&self) -> &NSURL {
1029        unsafe { &*((self as *const Self).cast()) }
1030    }
1031}
1032
1033#[cfg(feature = "objc2-core-foundation")]
1034impl AsRef<CFURL> for NSURL {
1035    #[inline]
1036    fn as_ref(&self) -> &CFURL {
1037        unsafe { &*((self as *const Self).cast()) }
1038    }
1039}
1040
1041#[cfg(feature = "NSObject")]
1042extern_conformance!(
1043    unsafe impl NSCoding for NSURL {}
1044);
1045
1046#[cfg(feature = "NSObject")]
1047extern_conformance!(
1048    unsafe impl NSCopying for NSURL {}
1049);
1050
1051#[cfg(feature = "NSObject")]
1052unsafe impl CopyingHelper for NSURL {
1053    type Result = Self;
1054}
1055
1056extern_conformance!(
1057    unsafe impl NSObjectProtocol for NSURL {}
1058);
1059
1060#[cfg(feature = "NSObject")]
1061extern_conformance!(
1062    unsafe impl NSSecureCoding for NSURL {}
1063);
1064
1065impl NSURL {
1066    extern_methods!(
1067        #[cfg(feature = "NSString")]
1068        #[deprecated = "Use NSURLComponents instead, which lets you create a valid URL with any valid combination of URL components and subcomponents (not just scheme, host and path), and lets you set components and subcomponents with either percent-encoded or un-percent-encoded strings."]
1069        #[unsafe(method(initWithScheme:host:path:))]
1070        #[unsafe(method_family = init)]
1071        pub fn initWithScheme_host_path(
1072            this: Allocated<Self>,
1073            scheme: &NSString,
1074            host: Option<&NSString>,
1075            path: &NSString,
1076        ) -> Option<Retained<Self>>;
1077
1078        #[cfg(feature = "NSString")]
1079        #[unsafe(method(initFileURLWithPath:isDirectory:relativeToURL:))]
1080        #[unsafe(method_family = init)]
1081        pub fn initFileURLWithPath_isDirectory_relativeToURL(
1082            this: Allocated<Self>,
1083            path: &NSString,
1084            is_dir: bool,
1085            base_url: Option<&NSURL>,
1086        ) -> Retained<Self>;
1087
1088        #[cfg(feature = "NSString")]
1089        #[unsafe(method(initFileURLWithPath:relativeToURL:))]
1090        #[unsafe(method_family = init)]
1091        pub fn initFileURLWithPath_relativeToURL(
1092            this: Allocated<Self>,
1093            path: &NSString,
1094            base_url: Option<&NSURL>,
1095        ) -> Retained<Self>;
1096
1097        #[cfg(feature = "NSString")]
1098        #[unsafe(method(initFileURLWithPath:isDirectory:))]
1099        #[unsafe(method_family = init)]
1100        pub fn initFileURLWithPath_isDirectory(
1101            this: Allocated<Self>,
1102            path: &NSString,
1103            is_dir: bool,
1104        ) -> Retained<Self>;
1105
1106        #[cfg(feature = "NSString")]
1107        #[unsafe(method(initFileURLWithPath:))]
1108        #[unsafe(method_family = init)]
1109        pub fn initFileURLWithPath(this: Allocated<Self>, path: &NSString) -> Retained<Self>;
1110
1111        #[cfg(feature = "NSString")]
1112        #[unsafe(method(fileURLWithPath:isDirectory:relativeToURL:))]
1113        #[unsafe(method_family = none)]
1114        pub fn fileURLWithPath_isDirectory_relativeToURL(
1115            path: &NSString,
1116            is_dir: bool,
1117            base_url: Option<&NSURL>,
1118        ) -> Retained<NSURL>;
1119
1120        #[cfg(feature = "NSString")]
1121        #[unsafe(method(fileURLWithPath:relativeToURL:))]
1122        #[unsafe(method_family = none)]
1123        pub fn fileURLWithPath_relativeToURL(
1124            path: &NSString,
1125            base_url: Option<&NSURL>,
1126        ) -> Retained<NSURL>;
1127
1128        #[cfg(feature = "NSString")]
1129        #[unsafe(method(fileURLWithPath:isDirectory:))]
1130        #[unsafe(method_family = none)]
1131        pub fn fileURLWithPath_isDirectory(path: &NSString, is_dir: bool) -> Retained<NSURL>;
1132
1133        #[cfg(feature = "NSString")]
1134        #[unsafe(method(fileURLWithPath:))]
1135        #[unsafe(method_family = none)]
1136        pub fn fileURLWithPath(path: &NSString) -> Retained<NSURL>;
1137
1138        /// # Safety
1139        ///
1140        /// `path` must be a valid pointer.
1141        #[unsafe(method(initFileURLWithFileSystemRepresentation:isDirectory:relativeToURL:))]
1142        #[unsafe(method_family = init)]
1143        pub unsafe fn initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL(
1144            this: Allocated<Self>,
1145            path: NonNull<c_char>,
1146            is_dir: bool,
1147            base_url: Option<&NSURL>,
1148        ) -> Retained<Self>;
1149
1150        /// # Safety
1151        ///
1152        /// `path` must be a valid pointer.
1153        #[unsafe(method(fileURLWithFileSystemRepresentation:isDirectory:relativeToURL:))]
1154        #[unsafe(method_family = none)]
1155        pub unsafe fn fileURLWithFileSystemRepresentation_isDirectory_relativeToURL(
1156            path: NonNull<c_char>,
1157            is_dir: bool,
1158            base_url: Option<&NSURL>,
1159        ) -> Retained<NSURL>;
1160
1161        #[cfg(feature = "NSString")]
1162        #[unsafe(method(initWithString:))]
1163        #[unsafe(method_family = init)]
1164        pub fn initWithString(
1165            this: Allocated<Self>,
1166            url_string: &NSString,
1167        ) -> Option<Retained<Self>>;
1168
1169        #[cfg(feature = "NSString")]
1170        #[unsafe(method(initWithString:relativeToURL:))]
1171        #[unsafe(method_family = init)]
1172        pub fn initWithString_relativeToURL(
1173            this: Allocated<Self>,
1174            url_string: &NSString,
1175            base_url: Option<&NSURL>,
1176        ) -> Option<Retained<Self>>;
1177
1178        #[cfg(feature = "NSString")]
1179        #[unsafe(method(URLWithString:))]
1180        #[unsafe(method_family = none)]
1181        pub fn URLWithString(url_string: &NSString) -> Option<Retained<Self>>;
1182
1183        #[cfg(feature = "NSString")]
1184        #[unsafe(method(URLWithString:relativeToURL:))]
1185        #[unsafe(method_family = none)]
1186        pub fn URLWithString_relativeToURL(
1187            url_string: &NSString,
1188            base_url: Option<&NSURL>,
1189        ) -> Option<Retained<Self>>;
1190
1191        #[cfg(feature = "NSString")]
1192        /// Initializes an `NSURL` with a URL string and the option to add (or skip) IDNA- and percent-encoding of invalid characters.
1193        /// If `encodingInvalidCharacters` is false, and the URL string is invalid according to RFC 3986, `nil` is returned.
1194        /// If `encodingInvalidCharacters` is true, `NSURL` will try to encode the string to create a valid URL.
1195        /// If the URL string is still invalid after encoding, `nil` is returned.
1196        ///
1197        /// - Parameter URLString: The URL string.
1198        /// - Parameter encodingInvalidCharacters: True if `NSURL` should try to encode an invalid URL string, false otherwise.
1199        /// - Returns: An `NSURL` instance for a valid URL, or `nil` if the URL is invalid.
1200        #[unsafe(method(initWithString:encodingInvalidCharacters:))]
1201        #[unsafe(method_family = init)]
1202        pub fn initWithString_encodingInvalidCharacters(
1203            this: Allocated<Self>,
1204            url_string: &NSString,
1205            encoding_invalid_characters: bool,
1206        ) -> Option<Retained<Self>>;
1207
1208        #[cfg(feature = "NSString")]
1209        /// Initializes and returns a newly created `NSURL` with a URL string and the option to add (or skip) IDNA- and percent-encoding of invalid characters.
1210        /// If `encodingInvalidCharacters` is false, and the URL string is invalid according to RFC 3986, `nil` is returned.
1211        /// If `encodingInvalidCharacters` is true, `NSURL` will try to encode the string to create a valid URL.
1212        /// If the URL string is still invalid after encoding, `nil` is returned.
1213        ///
1214        /// - Parameter URLString: The URL string.
1215        /// - Parameter encodingInvalidCharacters: True if `NSURL` should try to encode an invalid URL string, false otherwise.
1216        /// - Returns: An `NSURL` instance for a valid URL, or `nil` if the URL is invalid.
1217        #[unsafe(method(URLWithString:encodingInvalidCharacters:))]
1218        #[unsafe(method_family = none)]
1219        pub fn URLWithString_encodingInvalidCharacters(
1220            url_string: &NSString,
1221            encoding_invalid_characters: bool,
1222        ) -> Option<Retained<Self>>;
1223
1224        #[cfg(feature = "NSData")]
1225        #[unsafe(method(initWithDataRepresentation:relativeToURL:))]
1226        #[unsafe(method_family = init)]
1227        pub fn initWithDataRepresentation_relativeToURL(
1228            this: Allocated<Self>,
1229            data: &NSData,
1230            base_url: Option<&NSURL>,
1231        ) -> Retained<Self>;
1232
1233        #[cfg(feature = "NSData")]
1234        #[unsafe(method(URLWithDataRepresentation:relativeToURL:))]
1235        #[unsafe(method_family = none)]
1236        pub fn URLWithDataRepresentation_relativeToURL(
1237            data: &NSData,
1238            base_url: Option<&NSURL>,
1239        ) -> Retained<NSURL>;
1240
1241        #[cfg(feature = "NSData")]
1242        #[unsafe(method(initAbsoluteURLWithDataRepresentation:relativeToURL:))]
1243        #[unsafe(method_family = init)]
1244        pub fn initAbsoluteURLWithDataRepresentation_relativeToURL(
1245            this: Allocated<Self>,
1246            data: &NSData,
1247            base_url: Option<&NSURL>,
1248        ) -> Retained<Self>;
1249
1250        #[cfg(feature = "NSData")]
1251        #[unsafe(method(absoluteURLWithDataRepresentation:relativeToURL:))]
1252        #[unsafe(method_family = none)]
1253        pub fn absoluteURLWithDataRepresentation_relativeToURL(
1254            data: &NSData,
1255            base_url: Option<&NSURL>,
1256        ) -> Retained<NSURL>;
1257
1258        #[cfg(feature = "NSData")]
1259        #[unsafe(method(dataRepresentation))]
1260        #[unsafe(method_family = none)]
1261        pub fn dataRepresentation(&self) -> Retained<NSData>;
1262
1263        #[cfg(feature = "NSString")]
1264        #[unsafe(method(absoluteString))]
1265        #[unsafe(method_family = none)]
1266        pub fn absoluteString(&self) -> Option<Retained<NSString>>;
1267
1268        #[cfg(feature = "NSString")]
1269        #[unsafe(method(relativeString))]
1270        #[unsafe(method_family = none)]
1271        pub fn relativeString(&self) -> Retained<NSString>;
1272
1273        #[unsafe(method(baseURL))]
1274        #[unsafe(method_family = none)]
1275        pub fn baseURL(&self) -> Option<Retained<NSURL>>;
1276
1277        #[unsafe(method(absoluteURL))]
1278        #[unsafe(method_family = none)]
1279        pub fn absoluteURL(&self) -> Option<Retained<NSURL>>;
1280
1281        #[cfg(feature = "NSString")]
1282        #[unsafe(method(scheme))]
1283        #[unsafe(method_family = none)]
1284        pub fn scheme(&self) -> Option<Retained<NSString>>;
1285
1286        #[cfg(feature = "NSString")]
1287        #[unsafe(method(resourceSpecifier))]
1288        #[unsafe(method_family = none)]
1289        pub fn resourceSpecifier(&self) -> Option<Retained<NSString>>;
1290
1291        #[cfg(feature = "NSString")]
1292        #[unsafe(method(host))]
1293        #[unsafe(method_family = none)]
1294        pub fn host(&self) -> Option<Retained<NSString>>;
1295
1296        #[cfg(feature = "NSValue")]
1297        #[unsafe(method(port))]
1298        #[unsafe(method_family = none)]
1299        pub fn port(&self) -> Option<Retained<NSNumber>>;
1300
1301        #[cfg(feature = "NSString")]
1302        #[unsafe(method(user))]
1303        #[unsafe(method_family = none)]
1304        pub fn user(&self) -> Option<Retained<NSString>>;
1305
1306        #[cfg(feature = "NSString")]
1307        #[unsafe(method(password))]
1308        #[unsafe(method_family = none)]
1309        pub fn password(&self) -> Option<Retained<NSString>>;
1310
1311        #[cfg(feature = "NSString")]
1312        #[unsafe(method(path))]
1313        #[unsafe(method_family = none)]
1314        pub fn path(&self) -> Option<Retained<NSString>>;
1315
1316        #[cfg(feature = "NSString")]
1317        #[unsafe(method(fragment))]
1318        #[unsafe(method_family = none)]
1319        pub fn fragment(&self) -> Option<Retained<NSString>>;
1320
1321        #[cfg(feature = "NSString")]
1322        #[deprecated = "The parameterString method is deprecated. Post deprecation for applications linked with or after the macOS 10.15, and for all iOS, watchOS, and tvOS applications, parameterString will always return nil, and the path method will return the complete path including the semicolon separator and params component if the URL string contains them."]
1323        #[unsafe(method(parameterString))]
1324        #[unsafe(method_family = none)]
1325        pub fn parameterString(&self) -> Option<Retained<NSString>>;
1326
1327        #[cfg(feature = "NSString")]
1328        #[unsafe(method(query))]
1329        #[unsafe(method_family = none)]
1330        pub fn query(&self) -> Option<Retained<NSString>>;
1331
1332        #[cfg(feature = "NSString")]
1333        #[unsafe(method(relativePath))]
1334        #[unsafe(method_family = none)]
1335        pub fn relativePath(&self) -> Option<Retained<NSString>>;
1336
1337        #[unsafe(method(hasDirectoryPath))]
1338        #[unsafe(method_family = none)]
1339        pub fn hasDirectoryPath(&self) -> bool;
1340
1341        /// # Safety
1342        ///
1343        /// `buffer` must be a valid pointer.
1344        #[unsafe(method(getFileSystemRepresentation:maxLength:))]
1345        #[unsafe(method_family = none)]
1346        pub unsafe fn getFileSystemRepresentation_maxLength(
1347            &self,
1348            buffer: NonNull<c_char>,
1349            max_buffer_length: NSUInteger,
1350        ) -> bool;
1351
1352        #[unsafe(method(fileSystemRepresentation))]
1353        #[unsafe(method_family = none)]
1354        pub fn fileSystemRepresentation(&self) -> NonNull<c_char>;
1355
1356        #[unsafe(method(isFileURL))]
1357        #[unsafe(method_family = none)]
1358        pub fn isFileURL(&self) -> bool;
1359
1360        #[unsafe(method(standardizedURL))]
1361        #[unsafe(method_family = none)]
1362        pub fn standardizedURL(&self) -> Option<Retained<NSURL>>;
1363
1364        #[unsafe(method(isFileReferenceURL))]
1365        #[unsafe(method_family = none)]
1366        pub fn isFileReferenceURL(&self) -> bool;
1367
1368        #[unsafe(method(fileReferenceURL))]
1369        #[unsafe(method_family = none)]
1370        pub fn fileReferenceURL(&self) -> Option<Retained<NSURL>>;
1371
1372        #[unsafe(method(filePathURL))]
1373        #[unsafe(method_family = none)]
1374        pub fn filePathURL(&self) -> Option<Retained<NSURL>>;
1375
1376        #[cfg(all(feature = "NSError", feature = "NSString"))]
1377        /// # Safety
1378        ///
1379        /// `value` should be of the correct type.
1380        #[unsafe(method(getResourceValue:forKey:error:_))]
1381        #[unsafe(method_family = none)]
1382        pub unsafe fn getResourceValue_forKey_error(
1383            &self,
1384            value: &mut Option<Retained<AnyObject>>,
1385            key: &NSURLResourceKey,
1386        ) -> Result<(), Retained<NSError>>;
1387
1388        #[cfg(all(
1389            feature = "NSArray",
1390            feature = "NSDictionary",
1391            feature = "NSError",
1392            feature = "NSString"
1393        ))]
1394        #[unsafe(method(resourceValuesForKeys:error:_))]
1395        #[unsafe(method_family = none)]
1396        pub fn resourceValuesForKeys_error(
1397            &self,
1398            keys: &NSArray<NSURLResourceKey>,
1399        ) -> Result<Retained<NSDictionary<NSURLResourceKey, AnyObject>>, Retained<NSError>>;
1400
1401        #[cfg(all(feature = "NSError", feature = "NSString"))]
1402        /// # Safety
1403        ///
1404        /// `value` should be of the correct type.
1405        #[unsafe(method(setResourceValue:forKey:error:_))]
1406        #[unsafe(method_family = none)]
1407        pub unsafe fn setResourceValue_forKey_error(
1408            &self,
1409            value: Option<&AnyObject>,
1410            key: &NSURLResourceKey,
1411        ) -> Result<(), Retained<NSError>>;
1412
1413        #[cfg(all(feature = "NSDictionary", feature = "NSError", feature = "NSString"))]
1414        /// # Safety
1415        ///
1416        /// `keyed_values` generic should be of the correct type.
1417        #[unsafe(method(setResourceValues:error:_))]
1418        #[unsafe(method_family = none)]
1419        pub unsafe fn setResourceValues_error(
1420            &self,
1421            keyed_values: &NSDictionary<NSURLResourceKey, AnyObject>,
1422        ) -> Result<(), Retained<NSError>>;
1423
1424        #[cfg(feature = "NSString")]
1425        #[unsafe(method(removeCachedResourceValueForKey:))]
1426        #[unsafe(method_family = none)]
1427        pub fn removeCachedResourceValueForKey(&self, key: &NSURLResourceKey);
1428
1429        #[unsafe(method(removeAllCachedResourceValues))]
1430        #[unsafe(method_family = none)]
1431        pub fn removeAllCachedResourceValues(&self);
1432
1433        #[cfg(feature = "NSString")]
1434        /// # Safety
1435        ///
1436        /// `value` should be of the correct type.
1437        #[unsafe(method(setTemporaryResourceValue:forKey:))]
1438        #[unsafe(method_family = none)]
1439        pub unsafe fn setTemporaryResourceValue_forKey(
1440            &self,
1441            value: Option<&AnyObject>,
1442            key: &NSURLResourceKey,
1443        );
1444
1445        #[cfg(all(
1446            feature = "NSArray",
1447            feature = "NSData",
1448            feature = "NSError",
1449            feature = "NSString"
1450        ))]
1451        #[unsafe(method(bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error:_))]
1452        #[unsafe(method_family = none)]
1453        pub fn bookmarkDataWithOptions_includingResourceValuesForKeys_relativeToURL_error(
1454            &self,
1455            options: NSURLBookmarkCreationOptions,
1456            keys: Option<&NSArray<NSURLResourceKey>>,
1457            relative_url: Option<&NSURL>,
1458        ) -> Result<Retained<NSData>, Retained<NSError>>;
1459
1460        #[cfg(all(feature = "NSData", feature = "NSError"))]
1461        /// # Safety
1462        ///
1463        /// `is_stale` must be a valid pointer or null.
1464        #[unsafe(method(initByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:_))]
1465        #[unsafe(method_family = init)]
1466        pub unsafe fn initByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error(
1467            this: Allocated<Self>,
1468            bookmark_data: &NSData,
1469            options: NSURLBookmarkResolutionOptions,
1470            relative_url: Option<&NSURL>,
1471            is_stale: *mut Bool,
1472        ) -> Result<Retained<Self>, Retained<NSError>>;
1473
1474        #[cfg(all(feature = "NSData", feature = "NSError"))]
1475        /// # Safety
1476        ///
1477        /// `is_stale` must be a valid pointer or null.
1478        #[unsafe(method(URLByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:_))]
1479        #[unsafe(method_family = none)]
1480        pub unsafe fn URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error(
1481            bookmark_data: &NSData,
1482            options: NSURLBookmarkResolutionOptions,
1483            relative_url: Option<&NSURL>,
1484            is_stale: *mut Bool,
1485        ) -> Result<Retained<Self>, Retained<NSError>>;
1486
1487        #[cfg(all(
1488            feature = "NSArray",
1489            feature = "NSData",
1490            feature = "NSDictionary",
1491            feature = "NSString"
1492        ))]
1493        #[unsafe(method(resourceValuesForKeys:fromBookmarkData:))]
1494        #[unsafe(method_family = none)]
1495        pub fn resourceValuesForKeys_fromBookmarkData(
1496            keys: &NSArray<NSURLResourceKey>,
1497            bookmark_data: &NSData,
1498        ) -> Option<Retained<NSDictionary<NSURLResourceKey, AnyObject>>>;
1499
1500        #[cfg(all(feature = "NSData", feature = "NSError"))]
1501        #[unsafe(method(writeBookmarkData:toURL:options:error:_))]
1502        #[unsafe(method_family = none)]
1503        pub fn writeBookmarkData_toURL_options_error(
1504            bookmark_data: &NSData,
1505            bookmark_file_url: &NSURL,
1506            options: NSURLBookmarkFileCreationOptions,
1507        ) -> Result<(), Retained<NSError>>;
1508
1509        #[cfg(all(feature = "NSData", feature = "NSError"))]
1510        #[unsafe(method(bookmarkDataWithContentsOfURL:error:_))]
1511        #[unsafe(method_family = none)]
1512        pub fn bookmarkDataWithContentsOfURL_error(
1513            bookmark_file_url: &NSURL,
1514        ) -> Result<Retained<NSData>, Retained<NSError>>;
1515
1516        #[cfg(feature = "NSError")]
1517        #[unsafe(method(URLByResolvingAliasFileAtURL:options:error:_))]
1518        #[unsafe(method_family = none)]
1519        pub fn URLByResolvingAliasFileAtURL_options_error(
1520            url: &NSURL,
1521            options: NSURLBookmarkResolutionOptions,
1522        ) -> Result<Retained<Self>, Retained<NSError>>;
1523
1524        #[unsafe(method(startAccessingSecurityScopedResource))]
1525        #[unsafe(method_family = none)]
1526        pub unsafe fn startAccessingSecurityScopedResource(&self) -> bool;
1527
1528        #[unsafe(method(stopAccessingSecurityScopedResource))]
1529        #[unsafe(method_family = none)]
1530        pub unsafe fn stopAccessingSecurityScopedResource(&self);
1531    );
1532}
1533
1534/// Methods declared on superclass `NSObject`.
1535impl NSURL {
1536    extern_methods!(
1537        #[unsafe(method(init))]
1538        #[unsafe(method_family = init)]
1539        pub fn init(this: Allocated<Self>) -> Retained<Self>;
1540
1541        #[unsafe(method(new))]
1542        #[unsafe(method_family = new)]
1543        pub fn new() -> Retained<Self>;
1544    );
1545}
1546
1547impl DefaultRetained for NSURL {
1548    #[inline]
1549    fn default_retained() -> Retained<Self> {
1550        Self::new()
1551    }
1552}
1553
1554/// NSPromisedItems.
1555impl NSURL {
1556    extern_methods!(
1557        #[cfg(all(feature = "NSError", feature = "NSString"))]
1558        /// # Safety
1559        ///
1560        /// `value` should be of the correct type.
1561        #[unsafe(method(getPromisedItemResourceValue:forKey:error:_))]
1562        #[unsafe(method_family = none)]
1563        pub unsafe fn getPromisedItemResourceValue_forKey_error(
1564            &self,
1565            value: &mut Option<Retained<AnyObject>>,
1566            key: &NSURLResourceKey,
1567        ) -> Result<(), Retained<NSError>>;
1568
1569        #[cfg(all(
1570            feature = "NSArray",
1571            feature = "NSDictionary",
1572            feature = "NSError",
1573            feature = "NSString"
1574        ))]
1575        #[unsafe(method(promisedItemResourceValuesForKeys:error:_))]
1576        #[unsafe(method_family = none)]
1577        pub fn promisedItemResourceValuesForKeys_error(
1578            &self,
1579            keys: &NSArray<NSURLResourceKey>,
1580        ) -> Result<Retained<NSDictionary<NSURLResourceKey, AnyObject>>, Retained<NSError>>;
1581
1582        #[cfg(feature = "NSError")]
1583        #[unsafe(method(checkPromisedItemIsReachableAndReturnError:_))]
1584        #[unsafe(method_family = none)]
1585        pub fn checkPromisedItemIsReachableAndReturnError(&self) -> Result<(), Retained<NSError>>;
1586    );
1587}
1588
1589/// NSItemProvider.
1590impl NSURL {
1591    extern_methods!();
1592}
1593
1594#[cfg(feature = "NSItemProvider")]
1595extern_conformance!(
1596    unsafe impl NSItemProviderReading for NSURL {}
1597);
1598
1599#[cfg(feature = "NSItemProvider")]
1600extern_conformance!(
1601    unsafe impl NSItemProviderWriting for NSURL {}
1602);
1603
1604extern_class!(
1605    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlqueryitem?language=objc)
1606    #[unsafe(super(NSObject))]
1607    #[derive(Debug, PartialEq, Eq, Hash)]
1608    pub struct NSURLQueryItem;
1609);
1610
1611unsafe impl Send for NSURLQueryItem {}
1612
1613unsafe impl Sync for NSURLQueryItem {}
1614
1615#[cfg(feature = "NSObject")]
1616extern_conformance!(
1617    unsafe impl NSCoding for NSURLQueryItem {}
1618);
1619
1620#[cfg(feature = "NSObject")]
1621extern_conformance!(
1622    unsafe impl NSCopying for NSURLQueryItem {}
1623);
1624
1625#[cfg(feature = "NSObject")]
1626unsafe impl CopyingHelper for NSURLQueryItem {
1627    type Result = Self;
1628}
1629
1630extern_conformance!(
1631    unsafe impl NSObjectProtocol for NSURLQueryItem {}
1632);
1633
1634#[cfg(feature = "NSObject")]
1635extern_conformance!(
1636    unsafe impl NSSecureCoding for NSURLQueryItem {}
1637);
1638
1639impl NSURLQueryItem {
1640    extern_methods!(
1641        #[cfg(feature = "NSString")]
1642        #[unsafe(method(initWithName:value:))]
1643        #[unsafe(method_family = init)]
1644        pub fn initWithName_value(
1645            this: Allocated<Self>,
1646            name: &NSString,
1647            value: Option<&NSString>,
1648        ) -> Retained<Self>;
1649
1650        #[cfg(feature = "NSString")]
1651        #[unsafe(method(queryItemWithName:value:))]
1652        #[unsafe(method_family = none)]
1653        pub fn queryItemWithName_value(name: &NSString, value: Option<&NSString>)
1654            -> Retained<Self>;
1655
1656        #[cfg(feature = "NSString")]
1657        #[unsafe(method(name))]
1658        #[unsafe(method_family = none)]
1659        pub fn name(&self) -> Retained<NSString>;
1660
1661        #[cfg(feature = "NSString")]
1662        #[unsafe(method(value))]
1663        #[unsafe(method_family = none)]
1664        pub fn value(&self) -> Option<Retained<NSString>>;
1665    );
1666}
1667
1668/// Methods declared on superclass `NSObject`.
1669impl NSURLQueryItem {
1670    extern_methods!(
1671        #[unsafe(method(init))]
1672        #[unsafe(method_family = init)]
1673        pub fn init(this: Allocated<Self>) -> Retained<Self>;
1674
1675        #[unsafe(method(new))]
1676        #[unsafe(method_family = new)]
1677        pub fn new() -> Retained<Self>;
1678    );
1679}
1680
1681impl DefaultRetained for NSURLQueryItem {
1682    #[inline]
1683    fn default_retained() -> Retained<Self> {
1684        Self::new()
1685    }
1686}
1687
1688extern_class!(
1689    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsurlcomponents?language=objc)
1690    #[unsafe(super(NSObject))]
1691    #[derive(Debug, PartialEq, Eq, Hash)]
1692    pub struct NSURLComponents;
1693);
1694
1695#[cfg(feature = "NSObject")]
1696extern_conformance!(
1697    unsafe impl NSCopying for NSURLComponents {}
1698);
1699
1700#[cfg(feature = "NSObject")]
1701unsafe impl CopyingHelper for NSURLComponents {
1702    type Result = Self;
1703}
1704
1705extern_conformance!(
1706    unsafe impl NSObjectProtocol for NSURLComponents {}
1707);
1708
1709impl NSURLComponents {
1710    extern_methods!(
1711        #[unsafe(method(init))]
1712        #[unsafe(method_family = init)]
1713        pub fn init(this: Allocated<Self>) -> Retained<Self>;
1714
1715        #[unsafe(method(initWithURL:resolvingAgainstBaseURL:))]
1716        #[unsafe(method_family = init)]
1717        pub fn initWithURL_resolvingAgainstBaseURL(
1718            this: Allocated<Self>,
1719            url: &NSURL,
1720            resolve: bool,
1721        ) -> Option<Retained<Self>>;
1722
1723        #[unsafe(method(componentsWithURL:resolvingAgainstBaseURL:))]
1724        #[unsafe(method_family = none)]
1725        pub fn componentsWithURL_resolvingAgainstBaseURL(
1726            url: &NSURL,
1727            resolve: bool,
1728        ) -> Option<Retained<Self>>;
1729
1730        #[cfg(feature = "NSString")]
1731        #[unsafe(method(initWithString:))]
1732        #[unsafe(method_family = init)]
1733        pub fn initWithString(
1734            this: Allocated<Self>,
1735            url_string: &NSString,
1736        ) -> Option<Retained<Self>>;
1737
1738        #[cfg(feature = "NSString")]
1739        #[unsafe(method(componentsWithString:))]
1740        #[unsafe(method_family = none)]
1741        pub fn componentsWithString(url_string: &NSString) -> Option<Retained<Self>>;
1742
1743        #[cfg(feature = "NSString")]
1744        /// Initializes an `NSURLComponents` with a URL string and the option to add (or skip) IDNA- and percent-encoding of invalid characters.
1745        /// If `encodingInvalidCharacters` is false, and the URL string is invalid according to RFC 3986, `nil` is returned.
1746        /// If `encodingInvalidCharacters` is true, `NSURLComponents` will try to encode the string to create a valid URL.
1747        /// If the URL string is still invalid after encoding, `nil` is returned.
1748        ///
1749        /// - Parameter URLString: The URL string.
1750        /// - Parameter encodingInvalidCharacters: True if `NSURLComponents` should try to encode an invalid URL string, false otherwise.
1751        /// - Returns: An `NSURLComponents` instance for a valid URL, or `nil` if the URL is invalid.
1752        #[unsafe(method(initWithString:encodingInvalidCharacters:))]
1753        #[unsafe(method_family = init)]
1754        pub fn initWithString_encodingInvalidCharacters(
1755            this: Allocated<Self>,
1756            url_string: &NSString,
1757            encoding_invalid_characters: bool,
1758        ) -> Option<Retained<Self>>;
1759
1760        #[cfg(feature = "NSString")]
1761        /// Initializes and returns a newly created `NSURLComponents` with a URL string and the option to add (or skip) IDNA- and percent-encoding of invalid characters.
1762        /// If `encodingInvalidCharacters` is false, and the URL string is invalid according to RFC 3986, `nil` is returned.
1763        /// If `encodingInvalidCharacters` is true, `NSURLComponents` will try to encode the string to create a valid URL.
1764        /// If the URL string is still invalid after encoding, nil is returned.
1765        ///
1766        /// - Parameter URLString: The URL string.
1767        /// - Parameter encodingInvalidCharacters: True if `NSURLComponents` should try to encode an invalid URL string, false otherwise.
1768        /// - Returns: An `NSURLComponents` instance for a valid URL, or `nil` if the URL is invalid.
1769        #[unsafe(method(componentsWithString:encodingInvalidCharacters:))]
1770        #[unsafe(method_family = none)]
1771        pub fn componentsWithString_encodingInvalidCharacters(
1772            url_string: &NSString,
1773            encoding_invalid_characters: bool,
1774        ) -> Option<Retained<Self>>;
1775
1776        #[unsafe(method(URL))]
1777        #[unsafe(method_family = none)]
1778        pub fn URL(&self) -> Option<Retained<NSURL>>;
1779
1780        #[unsafe(method(URLRelativeToURL:))]
1781        #[unsafe(method_family = none)]
1782        pub fn URLRelativeToURL(&self, base_url: Option<&NSURL>) -> Option<Retained<NSURL>>;
1783
1784        #[cfg(feature = "NSString")]
1785        #[unsafe(method(string))]
1786        #[unsafe(method_family = none)]
1787        pub fn string(&self) -> Option<Retained<NSString>>;
1788
1789        #[cfg(feature = "NSString")]
1790        #[unsafe(method(scheme))]
1791        #[unsafe(method_family = none)]
1792        pub fn scheme(&self) -> Option<Retained<NSString>>;
1793
1794        #[cfg(feature = "NSString")]
1795        /// Setter for [`scheme`][Self::scheme].
1796        ///
1797        /// This is [copied][crate::NSCopying::copy] when set.
1798        #[unsafe(method(setScheme:))]
1799        #[unsafe(method_family = none)]
1800        pub fn setScheme(&self, scheme: Option<&NSString>);
1801
1802        #[cfg(feature = "NSString")]
1803        #[unsafe(method(user))]
1804        #[unsafe(method_family = none)]
1805        pub fn user(&self) -> Option<Retained<NSString>>;
1806
1807        #[cfg(feature = "NSString")]
1808        /// Setter for [`user`][Self::user].
1809        ///
1810        /// This is [copied][crate::NSCopying::copy] when set.
1811        #[unsafe(method(setUser:))]
1812        #[unsafe(method_family = none)]
1813        pub fn setUser(&self, user: Option<&NSString>);
1814
1815        #[cfg(feature = "NSString")]
1816        #[unsafe(method(password))]
1817        #[unsafe(method_family = none)]
1818        pub fn password(&self) -> Option<Retained<NSString>>;
1819
1820        #[cfg(feature = "NSString")]
1821        /// Setter for [`password`][Self::password].
1822        ///
1823        /// This is [copied][crate::NSCopying::copy] when set.
1824        #[unsafe(method(setPassword:))]
1825        #[unsafe(method_family = none)]
1826        pub fn setPassword(&self, password: Option<&NSString>);
1827
1828        #[cfg(feature = "NSString")]
1829        #[unsafe(method(host))]
1830        #[unsafe(method_family = none)]
1831        pub fn host(&self) -> Option<Retained<NSString>>;
1832
1833        #[cfg(feature = "NSString")]
1834        /// Setter for [`host`][Self::host].
1835        ///
1836        /// This is [copied][crate::NSCopying::copy] when set.
1837        #[unsafe(method(setHost:))]
1838        #[unsafe(method_family = none)]
1839        pub fn setHost(&self, host: Option<&NSString>);
1840
1841        #[cfg(feature = "NSValue")]
1842        #[unsafe(method(port))]
1843        #[unsafe(method_family = none)]
1844        pub fn port(&self) -> Option<Retained<NSNumber>>;
1845
1846        #[cfg(feature = "NSValue")]
1847        /// Setter for [`port`][Self::port].
1848        ///
1849        /// This is [copied][crate::NSCopying::copy] when set.
1850        #[unsafe(method(setPort:))]
1851        #[unsafe(method_family = none)]
1852        pub fn setPort(&self, port: Option<&NSNumber>);
1853
1854        #[cfg(feature = "NSString")]
1855        #[unsafe(method(path))]
1856        #[unsafe(method_family = none)]
1857        pub fn path(&self) -> Option<Retained<NSString>>;
1858
1859        #[cfg(feature = "NSString")]
1860        /// Setter for [`path`][Self::path].
1861        ///
1862        /// This is [copied][crate::NSCopying::copy] when set.
1863        #[unsafe(method(setPath:))]
1864        #[unsafe(method_family = none)]
1865        pub fn setPath(&self, path: Option<&NSString>);
1866
1867        #[cfg(feature = "NSString")]
1868        #[unsafe(method(query))]
1869        #[unsafe(method_family = none)]
1870        pub fn query(&self) -> Option<Retained<NSString>>;
1871
1872        #[cfg(feature = "NSString")]
1873        /// Setter for [`query`][Self::query].
1874        ///
1875        /// This is [copied][crate::NSCopying::copy] when set.
1876        #[unsafe(method(setQuery:))]
1877        #[unsafe(method_family = none)]
1878        pub fn setQuery(&self, query: Option<&NSString>);
1879
1880        #[cfg(feature = "NSString")]
1881        #[unsafe(method(fragment))]
1882        #[unsafe(method_family = none)]
1883        pub fn fragment(&self) -> Option<Retained<NSString>>;
1884
1885        #[cfg(feature = "NSString")]
1886        /// Setter for [`fragment`][Self::fragment].
1887        ///
1888        /// This is [copied][crate::NSCopying::copy] when set.
1889        #[unsafe(method(setFragment:))]
1890        #[unsafe(method_family = none)]
1891        pub fn setFragment(&self, fragment: Option<&NSString>);
1892
1893        #[cfg(feature = "NSString")]
1894        #[unsafe(method(percentEncodedUser))]
1895        #[unsafe(method_family = none)]
1896        pub fn percentEncodedUser(&self) -> Option<Retained<NSString>>;
1897
1898        #[cfg(feature = "NSString")]
1899        /// Setter for [`percentEncodedUser`][Self::percentEncodedUser].
1900        ///
1901        /// This is [copied][crate::NSCopying::copy] when set.
1902        #[unsafe(method(setPercentEncodedUser:))]
1903        #[unsafe(method_family = none)]
1904        pub fn setPercentEncodedUser(&self, percent_encoded_user: Option<&NSString>);
1905
1906        #[cfg(feature = "NSString")]
1907        #[unsafe(method(percentEncodedPassword))]
1908        #[unsafe(method_family = none)]
1909        pub fn percentEncodedPassword(&self) -> Option<Retained<NSString>>;
1910
1911        #[cfg(feature = "NSString")]
1912        /// Setter for [`percentEncodedPassword`][Self::percentEncodedPassword].
1913        ///
1914        /// This is [copied][crate::NSCopying::copy] when set.
1915        #[unsafe(method(setPercentEncodedPassword:))]
1916        #[unsafe(method_family = none)]
1917        pub fn setPercentEncodedPassword(&self, percent_encoded_password: Option<&NSString>);
1918
1919        #[cfg(feature = "NSString")]
1920        #[deprecated = "Use encodedHost instead"]
1921        #[unsafe(method(percentEncodedHost))]
1922        #[unsafe(method_family = none)]
1923        pub fn percentEncodedHost(&self) -> Option<Retained<NSString>>;
1924
1925        #[cfg(feature = "NSString")]
1926        /// Setter for [`percentEncodedHost`][Self::percentEncodedHost].
1927        ///
1928        /// This is [copied][crate::NSCopying::copy] when set.
1929        #[deprecated = "Use encodedHost instead"]
1930        #[unsafe(method(setPercentEncodedHost:))]
1931        #[unsafe(method_family = none)]
1932        pub fn setPercentEncodedHost(&self, percent_encoded_host: Option<&NSString>);
1933
1934        #[cfg(feature = "NSString")]
1935        #[unsafe(method(percentEncodedPath))]
1936        #[unsafe(method_family = none)]
1937        pub fn percentEncodedPath(&self) -> Option<Retained<NSString>>;
1938
1939        #[cfg(feature = "NSString")]
1940        /// Setter for [`percentEncodedPath`][Self::percentEncodedPath].
1941        ///
1942        /// This is [copied][crate::NSCopying::copy] when set.
1943        #[unsafe(method(setPercentEncodedPath:))]
1944        #[unsafe(method_family = none)]
1945        pub fn setPercentEncodedPath(&self, percent_encoded_path: Option<&NSString>);
1946
1947        #[cfg(feature = "NSString")]
1948        #[unsafe(method(percentEncodedQuery))]
1949        #[unsafe(method_family = none)]
1950        pub fn percentEncodedQuery(&self) -> Option<Retained<NSString>>;
1951
1952        #[cfg(feature = "NSString")]
1953        /// Setter for [`percentEncodedQuery`][Self::percentEncodedQuery].
1954        ///
1955        /// This is [copied][crate::NSCopying::copy] when set.
1956        #[unsafe(method(setPercentEncodedQuery:))]
1957        #[unsafe(method_family = none)]
1958        pub fn setPercentEncodedQuery(&self, percent_encoded_query: Option<&NSString>);
1959
1960        #[cfg(feature = "NSString")]
1961        #[unsafe(method(percentEncodedFragment))]
1962        #[unsafe(method_family = none)]
1963        pub fn percentEncodedFragment(&self) -> Option<Retained<NSString>>;
1964
1965        #[cfg(feature = "NSString")]
1966        /// Setter for [`percentEncodedFragment`][Self::percentEncodedFragment].
1967        ///
1968        /// This is [copied][crate::NSCopying::copy] when set.
1969        #[unsafe(method(setPercentEncodedFragment:))]
1970        #[unsafe(method_family = none)]
1971        pub fn setPercentEncodedFragment(&self, percent_encoded_fragment: Option<&NSString>);
1972
1973        #[cfg(feature = "NSString")]
1974        #[unsafe(method(encodedHost))]
1975        #[unsafe(method_family = none)]
1976        pub fn encodedHost(&self) -> Option<Retained<NSString>>;
1977
1978        #[cfg(feature = "NSString")]
1979        /// Setter for [`encodedHost`][Self::encodedHost].
1980        ///
1981        /// This is [copied][crate::NSCopying::copy] when set.
1982        #[unsafe(method(setEncodedHost:))]
1983        #[unsafe(method_family = none)]
1984        pub fn setEncodedHost(&self, encoded_host: Option<&NSString>);
1985
1986        #[cfg(feature = "NSRange")]
1987        #[unsafe(method(rangeOfScheme))]
1988        #[unsafe(method_family = none)]
1989        pub fn rangeOfScheme(&self) -> NSRange;
1990
1991        #[cfg(feature = "NSRange")]
1992        #[unsafe(method(rangeOfUser))]
1993        #[unsafe(method_family = none)]
1994        pub fn rangeOfUser(&self) -> NSRange;
1995
1996        #[cfg(feature = "NSRange")]
1997        #[unsafe(method(rangeOfPassword))]
1998        #[unsafe(method_family = none)]
1999        pub fn rangeOfPassword(&self) -> NSRange;
2000
2001        #[cfg(feature = "NSRange")]
2002        #[unsafe(method(rangeOfHost))]
2003        #[unsafe(method_family = none)]
2004        pub fn rangeOfHost(&self) -> NSRange;
2005
2006        #[cfg(feature = "NSRange")]
2007        #[unsafe(method(rangeOfPort))]
2008        #[unsafe(method_family = none)]
2009        pub fn rangeOfPort(&self) -> NSRange;
2010
2011        #[cfg(feature = "NSRange")]
2012        #[unsafe(method(rangeOfPath))]
2013        #[unsafe(method_family = none)]
2014        pub fn rangeOfPath(&self) -> NSRange;
2015
2016        #[cfg(feature = "NSRange")]
2017        #[unsafe(method(rangeOfQuery))]
2018        #[unsafe(method_family = none)]
2019        pub fn rangeOfQuery(&self) -> NSRange;
2020
2021        #[cfg(feature = "NSRange")]
2022        #[unsafe(method(rangeOfFragment))]
2023        #[unsafe(method_family = none)]
2024        pub fn rangeOfFragment(&self) -> NSRange;
2025
2026        #[cfg(feature = "NSArray")]
2027        #[unsafe(method(queryItems))]
2028        #[unsafe(method_family = none)]
2029        pub fn queryItems(&self) -> Option<Retained<NSArray<NSURLQueryItem>>>;
2030
2031        #[cfg(feature = "NSArray")]
2032        /// Setter for [`queryItems`][Self::queryItems].
2033        ///
2034        /// This is [copied][crate::NSCopying::copy] when set.
2035        #[unsafe(method(setQueryItems:))]
2036        #[unsafe(method_family = none)]
2037        pub fn setQueryItems(&self, query_items: Option<&NSArray<NSURLQueryItem>>);
2038
2039        #[cfg(feature = "NSArray")]
2040        #[unsafe(method(percentEncodedQueryItems))]
2041        #[unsafe(method_family = none)]
2042        pub fn percentEncodedQueryItems(&self) -> Option<Retained<NSArray<NSURLQueryItem>>>;
2043
2044        #[cfg(feature = "NSArray")]
2045        /// Setter for [`percentEncodedQueryItems`][Self::percentEncodedQueryItems].
2046        ///
2047        /// This is [copied][crate::NSCopying::copy] when set.
2048        #[unsafe(method(setPercentEncodedQueryItems:))]
2049        #[unsafe(method_family = none)]
2050        pub fn setPercentEncodedQueryItems(
2051            &self,
2052            percent_encoded_query_items: Option<&NSArray<NSURLQueryItem>>,
2053        );
2054    );
2055}
2056
2057/// Methods declared on superclass `NSObject`.
2058impl NSURLComponents {
2059    extern_methods!(
2060        #[unsafe(method(new))]
2061        #[unsafe(method_family = new)]
2062        pub fn new() -> Retained<Self>;
2063    );
2064}
2065
2066impl DefaultRetained for NSURLComponents {
2067    #[inline]
2068    fn default_retained() -> Retained<Self> {
2069        Self::new()
2070    }
2071}
2072
2073/// NSURLUtilities.
2074#[cfg(feature = "NSCharacterSet")]
2075impl NSCharacterSet {
2076    extern_methods!(
2077        #[unsafe(method(URLUserAllowedCharacterSet))]
2078        #[unsafe(method_family = none)]
2079        pub fn URLUserAllowedCharacterSet() -> Retained<NSCharacterSet>;
2080
2081        #[unsafe(method(URLPasswordAllowedCharacterSet))]
2082        #[unsafe(method_family = none)]
2083        pub fn URLPasswordAllowedCharacterSet() -> Retained<NSCharacterSet>;
2084
2085        #[unsafe(method(URLHostAllowedCharacterSet))]
2086        #[unsafe(method_family = none)]
2087        pub fn URLHostAllowedCharacterSet() -> Retained<NSCharacterSet>;
2088
2089        #[unsafe(method(URLPathAllowedCharacterSet))]
2090        #[unsafe(method_family = none)]
2091        pub fn URLPathAllowedCharacterSet() -> Retained<NSCharacterSet>;
2092
2093        #[unsafe(method(URLQueryAllowedCharacterSet))]
2094        #[unsafe(method_family = none)]
2095        pub fn URLQueryAllowedCharacterSet() -> Retained<NSCharacterSet>;
2096
2097        #[unsafe(method(URLFragmentAllowedCharacterSet))]
2098        #[unsafe(method_family = none)]
2099        pub fn URLFragmentAllowedCharacterSet() -> Retained<NSCharacterSet>;
2100    );
2101}
2102
2103/// NSURLUtilities.
2104#[cfg(feature = "NSString")]
2105impl NSString {
2106    extern_methods!(
2107        #[cfg(feature = "NSCharacterSet")]
2108        #[unsafe(method(stringByAddingPercentEncodingWithAllowedCharacters:))]
2109        #[unsafe(method_family = none)]
2110        pub fn stringByAddingPercentEncodingWithAllowedCharacters(
2111            &self,
2112            allowed_characters: &NSCharacterSet,
2113        ) -> Option<Retained<NSString>>;
2114
2115        #[unsafe(method(stringByRemovingPercentEncoding))]
2116        #[unsafe(method_family = none)]
2117        pub fn stringByRemovingPercentEncoding(&self) -> Option<Retained<NSString>>;
2118
2119        #[deprecated = "Use -stringByAddingPercentEncodingWithAllowedCharacters: instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent since each URL component or subcomponent has different rules for what characters are valid."]
2120        #[unsafe(method(stringByAddingPercentEscapesUsingEncoding:))]
2121        #[unsafe(method_family = none)]
2122        pub fn stringByAddingPercentEscapesUsingEncoding(
2123            &self,
2124            enc: NSStringEncoding,
2125        ) -> Option<Retained<NSString>>;
2126
2127        #[deprecated = "Use -stringByRemovingPercentEncoding instead, which always uses the recommended UTF-8 encoding."]
2128        #[unsafe(method(stringByReplacingPercentEscapesUsingEncoding:))]
2129        #[unsafe(method_family = none)]
2130        pub fn stringByReplacingPercentEscapesUsingEncoding(
2131            &self,
2132            enc: NSStringEncoding,
2133        ) -> Option<Retained<NSString>>;
2134    );
2135}
2136
2137/// NSURLPathUtilities.
2138impl NSURL {
2139    extern_methods!(
2140        #[cfg(all(feature = "NSArray", feature = "NSString"))]
2141        #[unsafe(method(fileURLWithPathComponents:))]
2142        #[unsafe(method_family = none)]
2143        pub fn fileURLWithPathComponents(components: &NSArray<NSString>)
2144            -> Option<Retained<NSURL>>;
2145
2146        #[cfg(all(feature = "NSArray", feature = "NSString"))]
2147        #[unsafe(method(pathComponents))]
2148        #[unsafe(method_family = none)]
2149        pub fn pathComponents(&self) -> Option<Retained<NSArray<NSString>>>;
2150
2151        #[cfg(feature = "NSString")]
2152        #[unsafe(method(lastPathComponent))]
2153        #[unsafe(method_family = none)]
2154        pub fn lastPathComponent(&self) -> Option<Retained<NSString>>;
2155
2156        #[cfg(feature = "NSString")]
2157        #[unsafe(method(pathExtension))]
2158        #[unsafe(method_family = none)]
2159        pub fn pathExtension(&self) -> Option<Retained<NSString>>;
2160
2161        #[cfg(feature = "NSString")]
2162        #[unsafe(method(URLByAppendingPathComponent:))]
2163        #[unsafe(method_family = none)]
2164        pub fn URLByAppendingPathComponent(
2165            &self,
2166            path_component: &NSString,
2167        ) -> Option<Retained<NSURL>>;
2168
2169        #[cfg(feature = "NSString")]
2170        #[unsafe(method(URLByAppendingPathComponent:isDirectory:))]
2171        #[unsafe(method_family = none)]
2172        pub fn URLByAppendingPathComponent_isDirectory(
2173            &self,
2174            path_component: &NSString,
2175            is_directory: bool,
2176        ) -> Option<Retained<NSURL>>;
2177
2178        #[unsafe(method(URLByDeletingLastPathComponent))]
2179        #[unsafe(method_family = none)]
2180        pub fn URLByDeletingLastPathComponent(&self) -> Option<Retained<NSURL>>;
2181
2182        #[cfg(feature = "NSString")]
2183        #[unsafe(method(URLByAppendingPathExtension:))]
2184        #[unsafe(method_family = none)]
2185        pub fn URLByAppendingPathExtension(
2186            &self,
2187            path_extension: &NSString,
2188        ) -> Option<Retained<NSURL>>;
2189
2190        #[unsafe(method(URLByDeletingPathExtension))]
2191        #[unsafe(method_family = none)]
2192        pub fn URLByDeletingPathExtension(&self) -> Option<Retained<NSURL>>;
2193
2194        #[cfg(feature = "NSError")]
2195        #[unsafe(method(checkResourceIsReachableAndReturnError:_))]
2196        #[unsafe(method_family = none)]
2197        pub fn checkResourceIsReachableAndReturnError(&self) -> Result<(), Retained<NSError>>;
2198
2199        #[unsafe(method(URLByStandardizingPath))]
2200        #[unsafe(method_family = none)]
2201        pub fn URLByStandardizingPath(&self) -> Option<Retained<NSURL>>;
2202
2203        #[unsafe(method(URLByResolvingSymlinksInPath))]
2204        #[unsafe(method_family = none)]
2205        pub fn URLByResolvingSymlinksInPath(&self) -> Option<Retained<NSURL>>;
2206    );
2207}
2208
2209extern_class!(
2210    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilesecurity?language=objc)
2211    #[unsafe(super(NSObject))]
2212    #[derive(Debug, PartialEq, Eq, Hash)]
2213    pub struct NSFileSecurity;
2214);
2215
2216#[cfg(feature = "objc2-core-foundation")]
2217impl AsRef<NSFileSecurity> for CFFileSecurity {
2218    #[inline]
2219    fn as_ref(&self) -> &NSFileSecurity {
2220        unsafe { &*((self as *const Self).cast()) }
2221    }
2222}
2223
2224#[cfg(feature = "objc2-core-foundation")]
2225impl AsRef<CFFileSecurity> for NSFileSecurity {
2226    #[inline]
2227    fn as_ref(&self) -> &CFFileSecurity {
2228        unsafe { &*((self as *const Self).cast()) }
2229    }
2230}
2231
2232#[cfg(feature = "NSObject")]
2233extern_conformance!(
2234    unsafe impl NSCoding for NSFileSecurity {}
2235);
2236
2237#[cfg(feature = "NSObject")]
2238extern_conformance!(
2239    unsafe impl NSCopying for NSFileSecurity {}
2240);
2241
2242#[cfg(feature = "NSObject")]
2243unsafe impl CopyingHelper for NSFileSecurity {
2244    type Result = Self;
2245}
2246
2247extern_conformance!(
2248    unsafe impl NSObjectProtocol for NSFileSecurity {}
2249);
2250
2251#[cfg(feature = "NSObject")]
2252extern_conformance!(
2253    unsafe impl NSSecureCoding for NSFileSecurity {}
2254);
2255
2256impl NSFileSecurity {
2257    extern_methods!(
2258        #[cfg(feature = "NSCoder")]
2259        /// # Safety
2260        ///
2261        /// `coder` possibly has further requirements.
2262        #[unsafe(method(initWithCoder:))]
2263        #[unsafe(method_family = init)]
2264        pub unsafe fn initWithCoder(
2265            this: Allocated<Self>,
2266            coder: &NSCoder,
2267        ) -> Option<Retained<Self>>;
2268    );
2269}
2270
2271/// Methods declared on superclass `NSObject`.
2272impl NSFileSecurity {
2273    extern_methods!(
2274        #[unsafe(method(init))]
2275        #[unsafe(method_family = init)]
2276        pub fn init(this: Allocated<Self>) -> Retained<Self>;
2277
2278        #[unsafe(method(new))]
2279        #[unsafe(method_family = new)]
2280        pub fn new() -> Retained<Self>;
2281    );
2282}
2283
2284impl DefaultRetained for NSFileSecurity {
2285    #[inline]
2286    fn default_retained() -> Retained<Self> {
2287        Self::new()
2288    }
2289}
2290
2291/// NSURLLoading.
2292impl NSURL {
2293    extern_methods!(
2294        #[cfg(feature = "NSData")]
2295        #[deprecated = "Use NSURLConnection instead"]
2296        #[unsafe(method(resourceDataUsingCache:))]
2297        #[unsafe(method_family = none)]
2298        pub fn resourceDataUsingCache(&self, should_use_cache: bool) -> Option<Retained<NSData>>;
2299
2300        /// # Safety
2301        ///
2302        /// `client` should be of the correct type.
2303        #[deprecated = "Use NSURLConnection instead"]
2304        #[unsafe(method(loadResourceDataNotifyingClient:usingCache:))]
2305        #[unsafe(method_family = none)]
2306        pub unsafe fn loadResourceDataNotifyingClient_usingCache(
2307            &self,
2308            client: &AnyObject,
2309            should_use_cache: bool,
2310        );
2311
2312        #[cfg(feature = "NSString")]
2313        #[deprecated = "Use NSURLConnection instead"]
2314        #[unsafe(method(propertyForKey:))]
2315        #[unsafe(method_family = none)]
2316        pub fn propertyForKey(&self, property_key: &NSString) -> Option<Retained<AnyObject>>;
2317
2318        #[cfg(feature = "NSData")]
2319        #[deprecated = "Use NSURLConnection instead"]
2320        #[unsafe(method(setResourceData:))]
2321        #[unsafe(method_family = none)]
2322        pub fn setResourceData(&self, data: &NSData) -> bool;
2323
2324        #[cfg(feature = "NSString")]
2325        /// # Safety
2326        ///
2327        /// `property` should be of the correct type.
2328        #[deprecated = "Use NSURLConnection instead"]
2329        #[unsafe(method(setProperty:forKey:))]
2330        #[unsafe(method_family = none)]
2331        pub unsafe fn setProperty_forKey(
2332            &self,
2333            property: &AnyObject,
2334            property_key: &NSString,
2335        ) -> bool;
2336
2337        #[cfg(feature = "NSURLHandle")]
2338        #[deprecated = "Use NSURLConnection instead"]
2339        #[unsafe(method(URLHandleUsingCache:))]
2340        #[unsafe(method_family = none)]
2341        pub fn URLHandleUsingCache(&self, should_use_cache: bool) -> Option<Retained<NSURLHandle>>;
2342    );
2343}