objc2-app-kit 0.3.2

Bindings to the AppKit framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-uniform-type-identifiers")]
#[cfg(target_vendor = "apple")]
use objc2_uniform_type_identifiers::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspaceiconcreationoptions?language=objc)
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWorkspaceIconCreationOptions(pub NSUInteger);
bitflags::bitflags! {
    impl NSWorkspaceIconCreationOptions: NSUInteger {
        #[doc(alias = "NSExcludeQuickDrawElementsIconCreationOption")]
        const ExcludeQuickDrawElementsIconCreationOption = 1<<1;
        #[doc(alias = "NSExclude10_4ElementsIconCreationOption")]
        const Exclude10_4ElementsIconCreationOption = 1<<2;
    }
}

unsafe impl Encode for NSWorkspaceIconCreationOptions {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSWorkspaceIconCreationOptions {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspace?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSWorkspace;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for NSWorkspace {}
);

impl NSWorkspace {
    extern_methods!(
        #[unsafe(method(sharedWorkspace))]
        #[unsafe(method_family = none)]
        pub fn sharedWorkspace() -> Retained<NSWorkspace>;

        #[unsafe(method(notificationCenter))]
        #[unsafe(method_family = none)]
        pub fn notificationCenter(&self) -> Retained<NSNotificationCenter>;

        #[unsafe(method(openURL:))]
        #[unsafe(method_family = none)]
        pub fn openURL(&self, url: &NSURL) -> bool;

        #[cfg(all(feature = "NSRunningApplication", feature = "block2"))]
        #[unsafe(method(openURL:configuration:completionHandler:))]
        #[unsafe(method_family = none)]
        pub fn openURL_configuration_completionHandler(
            &self,
            url: &NSURL,
            configuration: &NSWorkspaceOpenConfiguration,
            completion_handler: Option<
                &block2::DynBlock<dyn Fn(*mut NSRunningApplication, *mut NSError)>,
            >,
        );

        #[cfg(all(feature = "NSRunningApplication", feature = "block2"))]
        #[unsafe(method(openURLs:withApplicationAtURL:configuration:completionHandler:))]
        #[unsafe(method_family = none)]
        pub fn openURLs_withApplicationAtURL_configuration_completionHandler(
            &self,
            urls: &NSArray<NSURL>,
            application_url: &NSURL,
            configuration: &NSWorkspaceOpenConfiguration,
            completion_handler: Option<
                &block2::DynBlock<dyn Fn(*mut NSRunningApplication, *mut NSError)>,
            >,
        );

        #[cfg(all(feature = "NSRunningApplication", feature = "block2"))]
        #[unsafe(method(openApplicationAtURL:configuration:completionHandler:))]
        #[unsafe(method_family = none)]
        pub fn openApplicationAtURL_configuration_completionHandler(
            &self,
            application_url: &NSURL,
            configuration: &NSWorkspaceOpenConfiguration,
            completion_handler: Option<
                &block2::DynBlock<dyn Fn(*mut NSRunningApplication, *mut NSError)>,
            >,
        );

        #[unsafe(method(selectFile:inFileViewerRootedAtPath:))]
        #[unsafe(method_family = none)]
        pub fn selectFile_inFileViewerRootedAtPath(
            &self,
            full_path: Option<&NSString>,
            root_full_path: &NSString,
        ) -> bool;

        #[unsafe(method(activateFileViewerSelectingURLs:))]
        #[unsafe(method_family = none)]
        pub fn activateFileViewerSelectingURLs(&self, file_ur_ls: &NSArray<NSURL>);

        #[unsafe(method(showSearchResultsForQueryString:))]
        #[unsafe(method_family = none)]
        pub fn showSearchResultsForQueryString(&self, query_string: &NSString) -> bool;

        #[unsafe(method(noteFileSystemChanged:))]
        #[unsafe(method_family = none)]
        pub fn noteFileSystemChanged_(&self, path: &NSString);

        #[unsafe(method(isFilePackageAtPath:))]
        #[unsafe(method_family = none)]
        pub fn isFilePackageAtPath(&self, full_path: &NSString) -> bool;

        #[cfg(feature = "NSImage")]
        #[unsafe(method(iconForFile:))]
        #[unsafe(method_family = none)]
        pub fn iconForFile(&self, full_path: &NSString) -> Retained<NSImage>;

        #[cfg(feature = "NSImage")]
        #[unsafe(method(iconForFiles:))]
        #[unsafe(method_family = none)]
        pub fn iconForFiles(&self, full_paths: &NSArray<NSString>) -> Option<Retained<NSImage>>;

        #[cfg(all(feature = "NSImage", feature = "objc2-uniform-type-identifiers"))]
        #[cfg(target_vendor = "apple")]
        #[unsafe(method(iconForContentType:))]
        #[unsafe(method_family = none)]
        pub fn iconForContentType(&self, content_type: &UTType) -> Retained<NSImage>;

        #[cfg(feature = "NSImage")]
        #[unsafe(method(setIcon:forFile:options:))]
        #[unsafe(method_family = none)]
        pub fn setIcon_forFile_options(
            &self,
            image: Option<&NSImage>,
            full_path: &NSString,
            options: NSWorkspaceIconCreationOptions,
        ) -> bool;

        #[unsafe(method(fileLabels))]
        #[unsafe(method_family = none)]
        pub fn fileLabels(&self) -> Retained<NSArray<NSString>>;

        #[cfg(feature = "NSColor")]
        #[unsafe(method(fileLabelColors))]
        #[unsafe(method_family = none)]
        pub fn fileLabelColors(&self) -> Retained<NSArray<NSColor>>;

        #[cfg(feature = "block2")]
        #[unsafe(method(recycleURLs:completionHandler:))]
        #[unsafe(method_family = none)]
        pub fn recycleURLs_completionHandler(
            &self,
            ur_ls: &NSArray<NSURL>,
            handler: Option<
                &block2::DynBlock<dyn Fn(NonNull<NSDictionary<NSURL, NSURL>>, *mut NSError)>,
            >,
        );

        #[cfg(feature = "block2")]
        #[unsafe(method(duplicateURLs:completionHandler:))]
        #[unsafe(method_family = none)]
        pub fn duplicateURLs_completionHandler(
            &self,
            ur_ls: &NSArray<NSURL>,
            handler: Option<
                &block2::DynBlock<dyn Fn(NonNull<NSDictionary<NSURL, NSURL>>, *mut NSError)>,
            >,
        );

        /// # Safety
        ///
        /// - `removable_flag` must be a valid pointer or null.
        /// - `writable_flag` must be a valid pointer or null.
        /// - `unmountable_flag` must be a valid pointer or null.
        #[unsafe(method(getFileSystemInfoForPath:isRemovable:isWritable:isUnmountable:description:type:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getFileSystemInfoForPath_isRemovable_isWritable_isUnmountable_description_type(
            &self,
            full_path: &NSString,
            removable_flag: *mut Bool,
            writable_flag: *mut Bool,
            unmountable_flag: *mut Bool,
            description: Option<&mut Option<Retained<NSString>>>,
            file_system_type: Option<&mut Option<Retained<NSString>>>,
        ) -> bool;

        #[unsafe(method(unmountAndEjectDeviceAtPath:))]
        #[unsafe(method_family = none)]
        pub fn unmountAndEjectDeviceAtPath(&self, path: &NSString) -> bool;

        #[unsafe(method(unmountAndEjectDeviceAtURL:error:_))]
        #[unsafe(method_family = none)]
        pub fn unmountAndEjectDeviceAtURL_error(
            &self,
            url: &NSURL,
        ) -> Result<(), Retained<NSError>>;

        #[unsafe(method(extendPowerOffBy:))]
        #[unsafe(method_family = none)]
        pub fn extendPowerOffBy(&self, requested: NSInteger) -> NSInteger;

        #[unsafe(method(hideOtherApplications))]
        #[unsafe(method_family = none)]
        pub fn hideOtherApplications(&self);

        #[unsafe(method(URLForApplicationWithBundleIdentifier:))]
        #[unsafe(method_family = none)]
        pub fn URLForApplicationWithBundleIdentifier(
            &self,
            bundle_identifier: &NSString,
        ) -> Option<Retained<NSURL>>;

        #[unsafe(method(URLsForApplicationsWithBundleIdentifier:))]
        #[unsafe(method_family = none)]
        pub fn URLsForApplicationsWithBundleIdentifier(
            &self,
            bundle_identifier: &NSString,
        ) -> Retained<NSArray<NSURL>>;

        #[unsafe(method(URLForApplicationToOpenURL:))]
        #[unsafe(method_family = none)]
        pub fn URLForApplicationToOpenURL(&self, url: &NSURL) -> Option<Retained<NSURL>>;

        #[unsafe(method(URLsForApplicationsToOpenURL:))]
        #[unsafe(method_family = none)]
        pub fn URLsForApplicationsToOpenURL(&self, url: &NSURL) -> Retained<NSArray<NSURL>>;

        #[cfg(feature = "block2")]
        #[unsafe(method(setDefaultApplicationAtURL:toOpenContentTypeOfFileAtURL:completionHandler:))]
        #[unsafe(method_family = none)]
        pub fn setDefaultApplicationAtURL_toOpenContentTypeOfFileAtURL_completionHandler(
            &self,
            application_url: &NSURL,
            url: &NSURL,
            completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
        );

        #[cfg(feature = "block2")]
        #[unsafe(method(setDefaultApplicationAtURL:toOpenURLsWithScheme:completionHandler:))]
        #[unsafe(method_family = none)]
        pub fn setDefaultApplicationAtURL_toOpenURLsWithScheme_completionHandler(
            &self,
            application_url: &NSURL,
            url_scheme: &NSString,
            completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
        );

        #[cfg(feature = "block2")]
        #[unsafe(method(setDefaultApplicationAtURL:toOpenFileAtURL:completionHandler:))]
        #[unsafe(method_family = none)]
        pub fn setDefaultApplicationAtURL_toOpenFileAtURL_completionHandler(
            &self,
            application_url: &NSURL,
            url: &NSURL,
            completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
        );

        #[cfg(feature = "objc2-uniform-type-identifiers")]
        #[cfg(target_vendor = "apple")]
        #[unsafe(method(URLForApplicationToOpenContentType:))]
        #[unsafe(method_family = none)]
        pub fn URLForApplicationToOpenContentType(
            &self,
            content_type: &UTType,
        ) -> Option<Retained<NSURL>>;

        #[cfg(feature = "objc2-uniform-type-identifiers")]
        #[cfg(target_vendor = "apple")]
        #[unsafe(method(URLsForApplicationsToOpenContentType:))]
        #[unsafe(method_family = none)]
        pub fn URLsForApplicationsToOpenContentType(
            &self,
            content_type: &UTType,
        ) -> Retained<NSArray<NSURL>>;

        #[cfg(all(feature = "block2", feature = "objc2-uniform-type-identifiers"))]
        #[cfg(target_vendor = "apple")]
        #[unsafe(method(setDefaultApplicationAtURL:toOpenContentType:completionHandler:))]
        #[unsafe(method_family = none)]
        pub fn setDefaultApplicationAtURL_toOpenContentType_completionHandler(
            &self,
            application_url: &NSURL,
            content_type: &UTType,
            completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
        );

        #[cfg(feature = "NSRunningApplication")]
        #[unsafe(method(frontmostApplication))]
        #[unsafe(method_family = none)]
        pub fn frontmostApplication(&self) -> Option<Retained<NSRunningApplication>>;

        #[cfg(feature = "NSRunningApplication")]
        #[unsafe(method(menuBarOwningApplication))]
        #[unsafe(method_family = none)]
        pub fn menuBarOwningApplication(&self) -> Option<Retained<NSRunningApplication>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSWorkspace {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for NSWorkspace {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspaceopenconfiguration?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSWorkspaceOpenConfiguration;
);

extern_conformance!(
    unsafe impl NSCopying for NSWorkspaceOpenConfiguration {}
);

unsafe impl CopyingHelper for NSWorkspaceOpenConfiguration {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for NSWorkspaceOpenConfiguration {}
);

impl NSWorkspaceOpenConfiguration {
    extern_methods!(
        #[unsafe(method(configuration))]
        #[unsafe(method_family = none)]
        pub fn configuration() -> Retained<Self>;

        #[unsafe(method(promptsUserIfNeeded))]
        #[unsafe(method_family = none)]
        pub fn promptsUserIfNeeded(&self) -> bool;

        /// Setter for [`promptsUserIfNeeded`][Self::promptsUserIfNeeded].
        #[unsafe(method(setPromptsUserIfNeeded:))]
        #[unsafe(method_family = none)]
        pub fn setPromptsUserIfNeeded(&self, prompts_user_if_needed: bool);

        #[unsafe(method(addsToRecentItems))]
        #[unsafe(method_family = none)]
        pub fn addsToRecentItems(&self) -> bool;

        /// Setter for [`addsToRecentItems`][Self::addsToRecentItems].
        #[unsafe(method(setAddsToRecentItems:))]
        #[unsafe(method_family = none)]
        pub fn setAddsToRecentItems(&self, adds_to_recent_items: bool);

        #[unsafe(method(activates))]
        #[unsafe(method_family = none)]
        pub fn activates(&self) -> bool;

        /// Setter for [`activates`][Self::activates].
        #[unsafe(method(setActivates:))]
        #[unsafe(method_family = none)]
        pub fn setActivates(&self, activates: bool);

        #[unsafe(method(hides))]
        #[unsafe(method_family = none)]
        pub fn hides(&self) -> bool;

        /// Setter for [`hides`][Self::hides].
        #[unsafe(method(setHides:))]
        #[unsafe(method_family = none)]
        pub fn setHides(&self, hides: bool);

        #[unsafe(method(hidesOthers))]
        #[unsafe(method_family = none)]
        pub fn hidesOthers(&self) -> bool;

        /// Setter for [`hidesOthers`][Self::hidesOthers].
        #[unsafe(method(setHidesOthers:))]
        #[unsafe(method_family = none)]
        pub fn setHidesOthers(&self, hides_others: bool);

        #[unsafe(method(isForPrinting))]
        #[unsafe(method_family = none)]
        pub fn isForPrinting(&self) -> bool;

        /// Setter for [`isForPrinting`][Self::isForPrinting].
        #[unsafe(method(setForPrinting:))]
        #[unsafe(method_family = none)]
        pub fn setForPrinting(&self, for_printing: bool);

        #[unsafe(method(createsNewApplicationInstance))]
        #[unsafe(method_family = none)]
        pub fn createsNewApplicationInstance(&self) -> bool;

        /// Setter for [`createsNewApplicationInstance`][Self::createsNewApplicationInstance].
        #[unsafe(method(setCreatesNewApplicationInstance:))]
        #[unsafe(method_family = none)]
        pub fn setCreatesNewApplicationInstance(&self, creates_new_application_instance: bool);

        #[unsafe(method(allowsRunningApplicationSubstitution))]
        #[unsafe(method_family = none)]
        pub fn allowsRunningApplicationSubstitution(&self) -> bool;

        /// Setter for [`allowsRunningApplicationSubstitution`][Self::allowsRunningApplicationSubstitution].
        #[unsafe(method(setAllowsRunningApplicationSubstitution:))]
        #[unsafe(method_family = none)]
        pub fn setAllowsRunningApplicationSubstitution(
            &self,
            allows_running_application_substitution: bool,
        );

        #[unsafe(method(arguments))]
        #[unsafe(method_family = none)]
        pub fn arguments(&self) -> Retained<NSArray<NSString>>;

        /// Setter for [`arguments`][Self::arguments].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setArguments:))]
        #[unsafe(method_family = none)]
        pub fn setArguments(&self, arguments: &NSArray<NSString>);

        #[unsafe(method(environment))]
        #[unsafe(method_family = none)]
        pub fn environment(&self) -> Retained<NSDictionary<NSString, NSString>>;

        /// Setter for [`environment`][Self::environment].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setEnvironment:))]
        #[unsafe(method_family = none)]
        pub fn setEnvironment(&self, environment: &NSDictionary<NSString, NSString>);

        #[unsafe(method(appleEvent))]
        #[unsafe(method_family = none)]
        pub fn appleEvent(&self) -> Option<Retained<NSAppleEventDescriptor>>;

        /// Setter for [`appleEvent`][Self::appleEvent].
        #[unsafe(method(setAppleEvent:))]
        #[unsafe(method_family = none)]
        pub fn setAppleEvent(&self, apple_event: Option<&NSAppleEventDescriptor>);

        #[unsafe(method(requiresUniversalLinks))]
        #[unsafe(method_family = none)]
        pub fn requiresUniversalLinks(&self) -> bool;

        /// Setter for [`requiresUniversalLinks`][Self::requiresUniversalLinks].
        #[unsafe(method(setRequiresUniversalLinks:))]
        #[unsafe(method_family = none)]
        pub fn setRequiresUniversalLinks(&self, requires_universal_links: bool);
    );
}

/// Methods declared on superclass `NSObject`.
impl NSWorkspaceOpenConfiguration {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for NSWorkspaceOpenConfiguration {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacedesktopimageoptionkey?language=objc)
// NS_TYPED_ENUM
pub type NSWorkspaceDesktopImageOptionKey = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacedesktopimagescalingkey?language=objc)
    pub static NSWorkspaceDesktopImageScalingKey: &'static NSWorkspaceDesktopImageOptionKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacedesktopimageallowclippingkey?language=objc)
    pub static NSWorkspaceDesktopImageAllowClippingKey: &'static NSWorkspaceDesktopImageOptionKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacedesktopimagefillcolorkey?language=objc)
    pub static NSWorkspaceDesktopImageFillColorKey: &'static NSWorkspaceDesktopImageOptionKey;
}

/// NSDesktopImages.
impl NSWorkspace {
    extern_methods!(
        #[cfg(feature = "NSScreen")]
        /// # Safety
        ///
        /// `options` generic should be of the correct type.
        #[unsafe(method(setDesktopImageURL:forScreen:options:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDesktopImageURL_forScreen_options_error(
            &self,
            url: &NSURL,
            screen: &NSScreen,
            options: &NSDictionary<NSWorkspaceDesktopImageOptionKey, AnyObject>,
        ) -> Result<(), Retained<NSError>>;

        #[cfg(feature = "NSScreen")]
        #[unsafe(method(desktopImageURLForScreen:))]
        #[unsafe(method_family = none)]
        pub fn desktopImageURLForScreen(&self, screen: &NSScreen) -> Option<Retained<NSURL>>;

        #[cfg(feature = "NSScreen")]
        #[unsafe(method(desktopImageOptionsForScreen:))]
        #[unsafe(method_family = none)]
        pub fn desktopImageOptionsForScreen(
            &self,
            screen: &NSScreen,
        ) -> Option<Retained<NSDictionary<NSWorkspaceDesktopImageOptionKey, AnyObject>>>;
    );
}

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspaceauthorizationtype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWorkspaceAuthorizationType(pub NSInteger);
impl NSWorkspaceAuthorizationType {
    #[doc(alias = "NSWorkspaceAuthorizationTypeCreateSymbolicLink")]
    pub const CreateSymbolicLink: Self = Self(0);
    #[doc(alias = "NSWorkspaceAuthorizationTypeSetAttributes")]
    pub const SetAttributes: Self = Self(1);
    #[doc(alias = "NSWorkspaceAuthorizationTypeReplaceFile")]
    pub const ReplaceFile: Self = Self(2);
}

unsafe impl Encode for NSWorkspaceAuthorizationType {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSWorkspaceAuthorizationType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspaceauthorization?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSWorkspaceAuthorization;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for NSWorkspaceAuthorization {}
);

impl NSWorkspaceAuthorization {
    extern_methods!();
}

/// Methods declared on superclass `NSObject`.
impl NSWorkspaceAuthorization {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for NSWorkspaceAuthorization {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

/// NSWorkspaceAuthorization.
impl NSWorkspace {
    extern_methods!(
        #[cfg(feature = "block2")]
        #[unsafe(method(requestAuthorizationOfType:completionHandler:))]
        #[unsafe(method_family = none)]
        pub fn requestAuthorizationOfType_completionHandler(
            &self,
            r#type: NSWorkspaceAuthorizationType,
            completion_handler: &block2::DynBlock<
                dyn Fn(*mut NSWorkspaceAuthorization, *mut NSError),
            >,
        );
    );
}

mod private_NSFileManagerNSWorkspaceAuthorization {
    pub trait Sealed {}
}

/// Category "NSWorkspaceAuthorization" on [`NSFileManager`].
#[doc(alias = "NSWorkspaceAuthorization")]
pub unsafe trait NSFileManagerNSWorkspaceAuthorization:
    ClassType + Sized + private_NSFileManagerNSWorkspaceAuthorization::Sealed
{
    extern_methods!(
        #[unsafe(method(fileManagerWithAuthorization:))]
        #[unsafe(method_family = none)]
        fn fileManagerWithAuthorization(authorization: &NSWorkspaceAuthorization)
            -> Retained<Self>;
    );
}

impl private_NSFileManagerNSWorkspaceAuthorization::Sealed for NSFileManager {}
unsafe impl NSFileManagerNSWorkspaceAuthorization for NSFileManager {}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspaceapplicationkey?language=objc)
    pub static NSWorkspaceApplicationKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacewilllaunchapplicationnotification?language=objc)
    pub static NSWorkspaceWillLaunchApplicationNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacedidlaunchapplicationnotification?language=objc)
    pub static NSWorkspaceDidLaunchApplicationNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacedidterminateapplicationnotification?language=objc)
    pub static NSWorkspaceDidTerminateApplicationNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacedidhideapplicationnotification?language=objc)
    pub static NSWorkspaceDidHideApplicationNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacedidunhideapplicationnotification?language=objc)
    pub static NSWorkspaceDidUnhideApplicationNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacedidactivateapplicationnotification?language=objc)
    pub static NSWorkspaceDidActivateApplicationNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacediddeactivateapplicationnotification?language=objc)
    pub static NSWorkspaceDidDeactivateApplicationNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacevolumelocalizednamekey?language=objc)
    pub static NSWorkspaceVolumeLocalizedNameKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacevolumeurlkey?language=objc)
    pub static NSWorkspaceVolumeURLKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacevolumeoldlocalizednamekey?language=objc)
    pub static NSWorkspaceVolumeOldLocalizedNameKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacevolumeoldurlkey?language=objc)
    pub static NSWorkspaceVolumeOldURLKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacedidmountnotification?language=objc)
    pub static NSWorkspaceDidMountNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacedidunmountnotification?language=objc)
    pub static NSWorkspaceDidUnmountNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacewillunmountnotification?language=objc)
    pub static NSWorkspaceWillUnmountNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacedidrenamevolumenotification?language=objc)
    pub static NSWorkspaceDidRenameVolumeNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacewillpoweroffnotification?language=objc)
    pub static NSWorkspaceWillPowerOffNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacewillsleepnotification?language=objc)
    pub static NSWorkspaceWillSleepNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacedidwakenotification?language=objc)
    pub static NSWorkspaceDidWakeNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacescreensdidsleepnotification?language=objc)
    pub static NSWorkspaceScreensDidSleepNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacescreensdidwakenotification?language=objc)
    pub static NSWorkspaceScreensDidWakeNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacesessiondidbecomeactivenotification?language=objc)
    pub static NSWorkspaceSessionDidBecomeActiveNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacesessiondidresignactivenotification?language=objc)
    pub static NSWorkspaceSessionDidResignActiveNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacedidchangefilelabelsnotification?language=objc)
    pub static NSWorkspaceDidChangeFileLabelsNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspaceactivespacedidchangenotification?language=objc)
    pub static NSWorkspaceActiveSpaceDidChangeNotification: &'static NSNotificationName;
}

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacefileoperationname?language=objc)
#[deprecated]
// NS_TYPED_ENUM
pub type NSWorkspaceFileOperationName = NSString;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacelaunchoptions?language=objc)
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWorkspaceLaunchOptions(pub NSUInteger);
bitflags::bitflags! {
    impl NSWorkspaceLaunchOptions: NSUInteger {
        #[doc(alias = "NSWorkspaceLaunchAndPrint")]
#[deprecated = "Use -[NSWorkspaceOpenConfiguration setForPrinting:YES] instead."]
        const AndPrint = 0x00000002;
        #[doc(alias = "NSWorkspaceLaunchWithErrorPresentation")]
#[deprecated = "Use -[NSWorkspaceOpenConfiguration setPromptsUserIfNeeded:YES] instead."]
        const WithErrorPresentation = 0x00000040;
        #[doc(alias = "NSWorkspaceLaunchInhibitingBackgroundOnly")]
#[deprecated = "This option does nothing."]
        const InhibitingBackgroundOnly = 0x00000080;
        #[doc(alias = "NSWorkspaceLaunchWithoutAddingToRecents")]
#[deprecated = "Use -[NSWorkspaceOpenConfiguration setAddsToRecentItems:YES] instead."]
        const WithoutAddingToRecents = 0x00000100;
        #[doc(alias = "NSWorkspaceLaunchWithoutActivation")]
#[deprecated = "Use -[NSWorkspaceOpenConfiguration setActivates:NO] instead."]
        const WithoutActivation = 0x00000200;
        #[doc(alias = "NSWorkspaceLaunchAsync")]
#[deprecated = "When using NSWorkspaceOpenConfiguration, all launches are asynchronous."]
        const Async = 0x00010000;
        #[doc(alias = "NSWorkspaceLaunchNewInstance")]
#[deprecated = "Use -[NSWorkspaceOpenConfiguration setCreatesNewApplicationInstance:YES] instead."]
        const NewInstance = 0x00080000;
        #[doc(alias = "NSWorkspaceLaunchAndHide")]
#[deprecated = "Use -[NSWorkspaceOpenConfiguration setHides:YES] instead."]
        const AndHide = 0x00100000;
        #[doc(alias = "NSWorkspaceLaunchAndHideOthers")]
#[deprecated = "Use -[NSWorkspaceOpenConfiguration setHidesOthers:YES] instead."]
        const AndHideOthers = 0x00200000;
        #[doc(alias = "NSWorkspaceLaunchDefault")]
#[deprecated = "Use NSWorkspaceOpenConfiguration instead."]
        const Default = NSWorkspaceLaunchOptions::Async.0;
        #[doc(alias = "NSWorkspaceLaunchAllowingClassicStartup")]
#[deprecated = "The Classic environment is no longer supported."]
        const AllowingClassicStartup = 0x00020000;
        #[doc(alias = "NSWorkspaceLaunchPreferringClassic")]
#[deprecated = "The Classic environment is no longer supported."]
        const PreferringClassic = 0x00040000;
    }
}

unsafe impl Encode for NSWorkspaceLaunchOptions {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSWorkspaceLaunchOptions {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacelaunchconfigurationkey?language=objc)
#[deprecated = "Use NSWorkspaceOpenConfiguration instead."]
// NS_TYPED_ENUM
pub type NSWorkspaceLaunchConfigurationKey = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacelaunchconfigurationappleevent?language=objc)
    #[deprecated = "Use -[NSWorkspaceOpenConfiguration setAppleEvent:] instead."]
    pub static NSWorkspaceLaunchConfigurationAppleEvent: &'static NSWorkspaceLaunchConfigurationKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacelaunchconfigurationarguments?language=objc)
    #[deprecated = "Use -[NSWorkspaceOpenConfiguration setArguments:] instead."]
    pub static NSWorkspaceLaunchConfigurationArguments: &'static NSWorkspaceLaunchConfigurationKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacelaunchconfigurationenvironment?language=objc)
    #[deprecated = "Use -[NSWorkspaceOpenConfiguration setEnvironment:] instead."]
    pub static NSWorkspaceLaunchConfigurationEnvironment:
        &'static NSWorkspaceLaunchConfigurationKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacelaunchconfigurationarchitecture?language=objc)
    #[deprecated = "Do not specify an architecutre. When unspecified, the architecture for a new application instance will be determined based on the available architectures in its executable."]
    pub static NSWorkspaceLaunchConfigurationArchitecture:
        &'static NSWorkspaceLaunchConfigurationKey;
}

/// NSDeprecated.
impl NSWorkspace {
    extern_methods!(
        #[deprecated = "Use -[NSWorkspace openURL:] instead."]
        #[unsafe(method(openFile:))]
        #[unsafe(method_family = none)]
        pub fn openFile(&self, full_path: &NSString) -> bool;

        #[deprecated = "Use -[NSWorkspace openURLs:withApplicationAtURL:configuration:completionHandler:] instead."]
        #[unsafe(method(openFile:withApplication:))]
        #[unsafe(method_family = none)]
        pub fn openFile_withApplication(
            &self,
            full_path: &NSString,
            app_name: Option<&NSString>,
        ) -> bool;

        #[deprecated = "Use -[NSWorkspace openURLs:withApplicationAtURL:configuration:completionHandler:] instead."]
        #[unsafe(method(openFile:withApplication:andDeactivate:))]
        #[unsafe(method_family = none)]
        pub fn openFile_withApplication_andDeactivate(
            &self,
            full_path: &NSString,
            app_name: Option<&NSString>,
            flag: bool,
        ) -> bool;

        #[deprecated = "Use -[NSWorkspace openApplicationAtURL:configuration:completionHandler:] instead."]
        #[unsafe(method(launchApplication:))]
        #[unsafe(method_family = none)]
        pub fn launchApplication(&self, app_name: &NSString) -> bool;

        #[cfg(feature = "NSRunningApplication")]
        /// # Safety
        ///
        /// `configuration` generic should be of the correct type.
        #[deprecated = "Use -[NSWorkspace openApplicationAtURL:configuration:completionHandler:] instead."]
        #[unsafe(method(launchApplicationAtURL:options:configuration:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn launchApplicationAtURL_options_configuration_error(
            &self,
            url: &NSURL,
            options: NSWorkspaceLaunchOptions,
            configuration: &NSDictionary<NSWorkspaceLaunchConfigurationKey, AnyObject>,
        ) -> Result<Retained<NSRunningApplication>, Retained<NSError>>;

        #[cfg(feature = "NSRunningApplication")]
        /// # Safety
        ///
        /// `configuration` generic should be of the correct type.
        #[deprecated = "Use -[NSWorkspace openURL:configuration:completionHandler:] instead."]
        #[unsafe(method(openURL:options:configuration:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn openURL_options_configuration_error(
            &self,
            url: &NSURL,
            options: NSWorkspaceLaunchOptions,
            configuration: &NSDictionary<NSWorkspaceLaunchConfigurationKey, AnyObject>,
        ) -> Result<Retained<NSRunningApplication>, Retained<NSError>>;

        #[cfg(feature = "NSRunningApplication")]
        /// # Safety
        ///
        /// `configuration` generic should be of the correct type.
        #[deprecated = "Use -[NSWorkspace openURLs:withApplicationAtURL:configuration:completionHandler:] instead."]
        #[unsafe(method(openURLs:withApplicationAtURL:options:configuration:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn openURLs_withApplicationAtURL_options_configuration_error(
            &self,
            urls: &NSArray<NSURL>,
            application_url: &NSURL,
            options: NSWorkspaceLaunchOptions,
            configuration: &NSDictionary<NSWorkspaceLaunchConfigurationKey, AnyObject>,
        ) -> Result<Retained<NSRunningApplication>, Retained<NSError>>;

        #[deprecated = "Use -[NSWorkspace openApplicationAtURL:configuration:completionHandler:] instead."]
        #[unsafe(method(launchApplication:showIcon:autolaunch:))]
        #[unsafe(method_family = none)]
        pub fn launchApplication_showIcon_autolaunch(
            &self,
            app_name: &NSString,
            show_icon: bool,
            autolaunch: bool,
        ) -> bool;

        #[deprecated = "Use -[NSWorkspace URLForApplicationWithBundleIdentifier:] instead."]
        #[unsafe(method(fullPathForApplication:))]
        #[unsafe(method_family = none)]
        pub fn fullPathForApplication(&self, app_name: &NSString) -> Option<Retained<NSString>>;

        #[deprecated = "Use -[NSWorkspace URLForApplicationWithBundleIdentifier:] instead."]
        #[unsafe(method(absolutePathForAppBundleWithIdentifier:))]
        #[unsafe(method_family = none)]
        pub fn absolutePathForAppBundleWithIdentifier(
            &self,
            bundle_identifier: &NSString,
        ) -> Option<Retained<NSString>>;

        #[deprecated = "Use -[NSWorkspace openApplicationAtURL:configuration:completionHandler:] instead."]
        #[unsafe(method(launchAppWithBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifier:))]
        #[unsafe(method_family = none)]
        pub fn launchAppWithBundleIdentifier_options_additionalEventParamDescriptor_launchIdentifier(
            &self,
            bundle_identifier: &NSString,
            options: NSWorkspaceLaunchOptions,
            descriptor: Option<&NSAppleEventDescriptor>,
            identifier: Option<&mut Option<Retained<NSNumber>>>,
        ) -> bool;

        #[deprecated = "Use -[NSWorkspace openURLs:withApplicationAtURL:configuration:completionHandler:] instead."]
        #[unsafe(method(openURLs:withAppBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifiers:))]
        #[unsafe(method_family = none)]
        pub fn openURLs_withAppBundleIdentifier_options_additionalEventParamDescriptor_launchIdentifiers(
            &self,
            urls: &NSArray<NSURL>,
            bundle_identifier: Option<&NSString>,
            options: NSWorkspaceLaunchOptions,
            descriptor: Option<&NSAppleEventDescriptor>,
            identifiers: Option<&mut Option<Retained<NSArray<NSNumber>>>>,
        ) -> bool;

        #[deprecated]
        #[unsafe(method(openTempFile:))]
        #[unsafe(method_family = none)]
        pub fn openTempFile(&self, full_path: &NSString) -> bool;

        #[deprecated]
        #[unsafe(method(findApplications))]
        #[unsafe(method_family = none)]
        pub fn findApplications(&self);

        #[deprecated]
        #[unsafe(method(noteUserDefaultsChanged))]
        #[unsafe(method_family = none)]
        pub fn noteUserDefaultsChanged(&self);

        #[cfg(feature = "NSImage")]
        #[deprecated]
        #[unsafe(method(slideImage:from:to:))]
        #[unsafe(method_family = none)]
        pub fn slideImage_from_to(&self, image: &NSImage, from_point: NSPoint, to_point: NSPoint);

        #[deprecated]
        #[unsafe(method(checkForRemovableMedia))]
        #[unsafe(method_family = none)]
        pub fn checkForRemovableMedia(&self);

        #[deprecated]
        #[unsafe(method(noteFileSystemChanged))]
        #[unsafe(method_family = none)]
        pub fn noteFileSystemChanged(&self);

        #[deprecated]
        #[unsafe(method(fileSystemChanged))]
        #[unsafe(method_family = none)]
        pub fn fileSystemChanged(&self) -> bool;

        #[deprecated]
        #[unsafe(method(userDefaultsChanged))]
        #[unsafe(method_family = none)]
        pub fn userDefaultsChanged(&self) -> bool;

        #[deprecated]
        #[unsafe(method(mountNewRemovableMedia))]
        #[unsafe(method_family = none)]
        pub fn mountNewRemovableMedia(&self) -> Option<Retained<NSArray>>;

        #[deprecated = "Use -[NSWorkspace frontmostApplication] instead."]
        #[unsafe(method(activeApplication))]
        #[unsafe(method_family = none)]
        pub fn activeApplication(&self) -> Option<Retained<NSDictionary>>;

        #[deprecated = "Use -[NSFileManager mountedVolumeURLsIncludingResourceValuesForKeys:options:] instead."]
        #[unsafe(method(mountedLocalVolumePaths))]
        #[unsafe(method_family = none)]
        pub fn mountedLocalVolumePaths(&self) -> Option<Retained<NSArray>>;

        #[deprecated = "Use -[NSFileManager mountedVolumeURLsIncludingResourceValuesForKeys:options:] instead."]
        #[unsafe(method(mountedRemovableMedia))]
        #[unsafe(method_family = none)]
        pub fn mountedRemovableMedia(&self) -> Option<Retained<NSArray>>;

        #[deprecated = "Use -[NSWorkspace runningApplications] instead."]
        #[unsafe(method(launchedApplications))]
        #[unsafe(method_family = none)]
        pub fn launchedApplications(&self) -> Option<Retained<NSArray>>;

        #[cfg(all(feature = "NSImage", feature = "NSResponder", feature = "NSView"))]
        #[deprecated = "Use -[NSWorkspace openURL:] instead."]
        #[unsafe(method(openFile:fromImage:at:inView:))]
        #[unsafe(method_family = none)]
        pub fn openFile_fromImage_at_inView(
            &self,
            full_path: &NSString,
            image: Option<&NSImage>,
            point: NSPoint,
            view: Option<&NSView>,
        ) -> bool;

        /// # Safety
        ///
        /// - `files` generic should be of the correct type.
        /// - `tag` must be a valid pointer or null.
        #[deprecated]
        #[unsafe(method(performFileOperation:source:destination:files:tag:))]
        #[unsafe(method_family = none)]
        pub unsafe fn performFileOperation_source_destination_files_tag(
            &self,
            operation: &NSWorkspaceFileOperationName,
            source: &NSString,
            destination: &NSString,
            files: &NSArray,
            tag: *mut NSInteger,
        ) -> bool;

        #[deprecated = "Use -[NSWorkspace URLForApplicationToOpenURL:] to get the URL of an application that will open a given item, or -[NSURL getResourceValue:forKey:error:] with NSURLContentTypeKey to get the type of the given item."]
        #[unsafe(method(getInfoForFile:application:type:))]
        #[unsafe(method_family = none)]
        pub fn getInfoForFile_application_type(
            &self,
            full_path: &NSString,
            app_name: Option<&mut Option<Retained<NSString>>>,
            r#type: Option<&mut Option<Retained<NSString>>>,
        ) -> bool;

        #[cfg(feature = "NSImage")]
        #[deprecated = "Use -[NSWorkspace iconForContentType:] instead."]
        #[unsafe(method(iconForFileType:))]
        #[unsafe(method_family = none)]
        pub fn iconForFileType(&self, file_type: &NSString) -> Retained<NSImage>;

        #[deprecated = "Use -[NSURL getResourceValue:forKey:error:] with NSURLContentTypeKey instead."]
        #[unsafe(method(typeOfFile:error:_))]
        #[unsafe(method_family = none)]
        pub fn typeOfFile_error(
            &self,
            absolute_file_path: &NSString,
        ) -> Result<Retained<NSString>, Retained<NSError>>;

        #[deprecated = "Use UTType.localizedDescription instead."]
        #[unsafe(method(localizedDescriptionForType:))]
        #[unsafe(method_family = none)]
        pub fn localizedDescriptionForType(
            &self,
            type_name: &NSString,
        ) -> Option<Retained<NSString>>;

        #[deprecated = "Use UTType.preferredFilenameExtension instead."]
        #[unsafe(method(preferredFilenameExtensionForType:))]
        #[unsafe(method_family = none)]
        pub fn preferredFilenameExtensionForType(
            &self,
            type_name: &NSString,
        ) -> Option<Retained<NSString>>;

        #[deprecated = "Use +[UTType typesWithTag:tagClass:conformingToType:] to get a list of candidate types, then check if the input type conforms to any of them."]
        #[unsafe(method(filenameExtension:isValidForType:))]
        #[unsafe(method_family = none)]
        pub fn filenameExtension_isValidForType(
            &self,
            filename_extension: &NSString,
            type_name: &NSString,
        ) -> bool;

        #[deprecated = "Use -[UTType conformsToType:] instead."]
        #[unsafe(method(type:conformsToType:))]
        #[unsafe(method_family = none)]
        pub fn type_conformsToType(
            &self,
            first_type_name: &NSString,
            second_type_name: &NSString,
        ) -> bool;
    );
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacemoveoperation?language=objc)
    #[deprecated = "Use -[NSFileManager moveItemAtURL:toURL:error:] instead."]
    pub static NSWorkspaceMoveOperation: &'static NSWorkspaceFileOperationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacecopyoperation?language=objc)
    #[deprecated = "Use -[NSFileManager copyItemAtURL:toURL:error:] instead."]
    pub static NSWorkspaceCopyOperation: &'static NSWorkspaceFileOperationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacelinkoperation?language=objc)
    #[deprecated = "Use -[NSFileManager linkItemAtURL:toURL:error:] instead."]
    pub static NSWorkspaceLinkOperation: &'static NSWorkspaceFileOperationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacecompressoperation?language=objc)
    #[deprecated = "This operation is unimplemented."]
    pub static NSWorkspaceCompressOperation: &'static NSWorkspaceFileOperationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacedecompressoperation?language=objc)
    #[deprecated = "This operation is unimplemented."]
    pub static NSWorkspaceDecompressOperation: &'static NSWorkspaceFileOperationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspaceencryptoperation?language=objc)
    #[deprecated = "This operation is unimplemented."]
    pub static NSWorkspaceEncryptOperation: &'static NSWorkspaceFileOperationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacedecryptoperation?language=objc)
    #[deprecated = "This operation is unimplemented."]
    pub static NSWorkspaceDecryptOperation: &'static NSWorkspaceFileOperationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacedestroyoperation?language=objc)
    #[deprecated = "Use -[NSFileManager removeItemAtURL:error:] instead."]
    pub static NSWorkspaceDestroyOperation: &'static NSWorkspaceFileOperationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacerecycleoperation?language=objc)
    #[deprecated = "Use -[NSWorkspace recycleURLs:completionHandler:] instead."]
    pub static NSWorkspaceRecycleOperation: &'static NSWorkspaceFileOperationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspaceduplicateoperation?language=objc)
    #[deprecated = "Use -[NSWorkspace duplicateURLs:completionHandler:] instead."]
    pub static NSWorkspaceDuplicateOperation: &'static NSWorkspaceFileOperationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsworkspacedidperformfileoperationnotification?language=objc)
    #[deprecated]
    pub static NSWorkspaceDidPerformFileOperationNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsplainfiletype?language=objc)
    #[deprecated]
    pub static NSPlainFileType: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdirectoryfiletype?language=objc)
    #[deprecated]
    pub static NSDirectoryFileType: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsapplicationfiletype?language=objc)
    #[deprecated]
    pub static NSApplicationFileType: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsfilesystemfiletype?language=objc)
    #[deprecated]
    pub static NSFilesystemFileType: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsshellcommandfiletype?language=objc)
    #[deprecated]
    pub static NSShellCommandFileType: &'static NSString;
}