objc2-core-foundation 0.3.2

Bindings to the CoreFoundation 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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::cell::UnsafeCell;
use core::marker::{PhantomData, PhantomPinned};
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cflocaleidentifier?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type CFLocaleIdentifier = CFString;

/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cflocalekey?language=objc)
// NS_TYPED_ENUM
pub type CFLocaleKey = CFString;

/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cflocale?language=objc)
///
/// This is toll-free bridged with `NSLocale`.
#[doc(alias = "CFLocaleRef")]
#[repr(C)]
pub struct CFLocale {
    inner: [u8; 0],
    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}

cf_type!(
    unsafe impl CFLocale {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
    unsafe impl RefEncode<"__CFLocale"> for CFLocale {}
);

unsafe impl ConcreteType for CFLocale {
    #[doc(alias = "CFLocaleGetTypeID")]
    #[inline]
    fn type_id() -> CFTypeID {
        extern "C-unwind" {
            fn CFLocaleGetTypeID() -> CFTypeID;
        }
        unsafe { CFLocaleGetTypeID() }
    }
}

impl CFLocale {
    #[doc(alias = "CFLocaleGetSystem")]
    #[inline]
    pub fn system() -> Option<CFRetained<CFLocale>> {
        extern "C-unwind" {
            fn CFLocaleGetSystem() -> Option<NonNull<CFLocale>>;
        }
        let ret = unsafe { CFLocaleGetSystem() };
        ret.map(|ret| unsafe { CFRetained::retain(ret) })
    }

    #[doc(alias = "CFLocaleCopyCurrent")]
    #[inline]
    pub fn current() -> Option<CFRetained<CFLocale>> {
        extern "C-unwind" {
            fn CFLocaleCopyCurrent() -> Option<NonNull<CFLocale>>;
        }
        let ret = unsafe { CFLocaleCopyCurrent() };
        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
    }

    #[doc(alias = "CFLocaleCopyAvailableLocaleIdentifiers")]
    #[cfg(feature = "CFArray")]
    #[inline]
    pub fn available_locale_identifiers() -> Option<CFRetained<CFArray>> {
        extern "C-unwind" {
            fn CFLocaleCopyAvailableLocaleIdentifiers() -> Option<NonNull<CFArray>>;
        }
        let ret = unsafe { CFLocaleCopyAvailableLocaleIdentifiers() };
        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
    }

    #[doc(alias = "CFLocaleCopyISOLanguageCodes")]
    #[cfg(feature = "CFArray")]
    #[inline]
    pub fn iso_language_codes() -> Option<CFRetained<CFArray>> {
        extern "C-unwind" {
            fn CFLocaleCopyISOLanguageCodes() -> Option<NonNull<CFArray>>;
        }
        let ret = unsafe { CFLocaleCopyISOLanguageCodes() };
        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
    }

    #[doc(alias = "CFLocaleCopyISOCountryCodes")]
    #[cfg(feature = "CFArray")]
    #[inline]
    pub fn iso_country_codes() -> Option<CFRetained<CFArray>> {
        extern "C-unwind" {
            fn CFLocaleCopyISOCountryCodes() -> Option<NonNull<CFArray>>;
        }
        let ret = unsafe { CFLocaleCopyISOCountryCodes() };
        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
    }

    #[doc(alias = "CFLocaleCopyISOCurrencyCodes")]
    #[cfg(feature = "CFArray")]
    #[inline]
    pub fn iso_currency_codes() -> Option<CFRetained<CFArray>> {
        extern "C-unwind" {
            fn CFLocaleCopyISOCurrencyCodes() -> Option<NonNull<CFArray>>;
        }
        let ret = unsafe { CFLocaleCopyISOCurrencyCodes() };
        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
    }

    #[doc(alias = "CFLocaleCopyCommonISOCurrencyCodes")]
    #[cfg(feature = "CFArray")]
    #[inline]
    pub fn common_iso_currency_codes() -> Option<CFRetained<CFArray>> {
        extern "C-unwind" {
            fn CFLocaleCopyCommonISOCurrencyCodes() -> Option<NonNull<CFArray>>;
        }
        let ret = unsafe { CFLocaleCopyCommonISOCurrencyCodes() };
        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
    }

    #[doc(alias = "CFLocaleCopyPreferredLanguages")]
    #[cfg(feature = "CFArray")]
    #[inline]
    pub fn preferred_languages() -> Option<CFRetained<CFArray>> {
        extern "C-unwind" {
            fn CFLocaleCopyPreferredLanguages() -> Option<NonNull<CFArray>>;
        }
        let ret = unsafe { CFLocaleCopyPreferredLanguages() };
        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
    }

    #[doc(alias = "CFLocaleCreateCanonicalLanguageIdentifierFromString")]
    #[inline]
    pub fn new_canonical_language_identifier_from_string(
        allocator: Option<&CFAllocator>,
        locale_identifier: Option<&CFString>,
    ) -> Option<CFRetained<CFLocaleIdentifier>> {
        extern "C-unwind" {
            fn CFLocaleCreateCanonicalLanguageIdentifierFromString(
                allocator: Option<&CFAllocator>,
                locale_identifier: Option<&CFString>,
            ) -> Option<NonNull<CFLocaleIdentifier>>;
        }
        let ret = unsafe {
            CFLocaleCreateCanonicalLanguageIdentifierFromString(allocator, locale_identifier)
        };
        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
    }

    #[doc(alias = "CFLocaleCreateCanonicalLocaleIdentifierFromString")]
    #[inline]
    pub fn new_canonical_locale_identifier_from_string(
        allocator: Option<&CFAllocator>,
        locale_identifier: Option<&CFString>,
    ) -> Option<CFRetained<CFLocaleIdentifier>> {
        extern "C-unwind" {
            fn CFLocaleCreateCanonicalLocaleIdentifierFromString(
                allocator: Option<&CFAllocator>,
                locale_identifier: Option<&CFString>,
            ) -> Option<NonNull<CFLocaleIdentifier>>;
        }
        let ret = unsafe {
            CFLocaleCreateCanonicalLocaleIdentifierFromString(allocator, locale_identifier)
        };
        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
    }

    #[doc(alias = "CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes")]
    #[inline]
    pub fn new_canonical_locale_identifier_from_script_manager_codes(
        allocator: Option<&CFAllocator>,
        lcode: LangCode,
        rcode: RegionCode,
    ) -> Option<CFRetained<CFLocaleIdentifier>> {
        extern "C-unwind" {
            fn CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(
                allocator: Option<&CFAllocator>,
                lcode: LangCode,
                rcode: RegionCode,
            ) -> Option<NonNull<CFLocaleIdentifier>>;
        }
        let ret = unsafe {
            CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(allocator, lcode, rcode)
        };
        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
    }

    #[doc(alias = "CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode")]
    #[inline]
    pub fn new_locale_identifier_from_windows_locale_code(
        allocator: Option<&CFAllocator>,
        lcid: u32,
    ) -> Option<CFRetained<CFLocaleIdentifier>> {
        extern "C-unwind" {
            fn CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode(
                allocator: Option<&CFAllocator>,
                lcid: u32,
            ) -> Option<NonNull<CFLocaleIdentifier>>;
        }
        let ret = unsafe { CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode(allocator, lcid) };
        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
    }

    #[doc(alias = "CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier")]
    #[inline]
    pub fn windows_locale_code_from_locale_identifier(
        locale_identifier: Option<&CFLocaleIdentifier>,
    ) -> u32 {
        extern "C-unwind" {
            fn CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier(
                locale_identifier: Option<&CFLocaleIdentifier>,
            ) -> u32;
        }
        unsafe { CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier(locale_identifier) }
    }
}

/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cflocalelanguagedirection?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CFLocaleLanguageDirection(pub CFIndex);
impl CFLocaleLanguageDirection {
    #[doc(alias = "kCFLocaleLanguageDirectionUnknown")]
    pub const Unknown: Self = Self(0);
    #[doc(alias = "kCFLocaleLanguageDirectionLeftToRight")]
    pub const LeftToRight: Self = Self(1);
    #[doc(alias = "kCFLocaleLanguageDirectionRightToLeft")]
    pub const RightToLeft: Self = Self(2);
    #[doc(alias = "kCFLocaleLanguageDirectionTopToBottom")]
    pub const TopToBottom: Self = Self(3);
    #[doc(alias = "kCFLocaleLanguageDirectionBottomToTop")]
    pub const BottomToTop: Self = Self(4);
}

#[cfg(feature = "objc2")]
unsafe impl Encode for CFLocaleLanguageDirection {
    const ENCODING: Encoding = CFIndex::ENCODING;
}

#[cfg(feature = "objc2")]
unsafe impl RefEncode for CFLocaleLanguageDirection {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

impl CFLocale {
    #[doc(alias = "CFLocaleGetLanguageCharacterDirection")]
    #[inline]
    pub fn language_character_direction(
        iso_lang_code: Option<&CFString>,
    ) -> CFLocaleLanguageDirection {
        extern "C-unwind" {
            fn CFLocaleGetLanguageCharacterDirection(
                iso_lang_code: Option<&CFString>,
            ) -> CFLocaleLanguageDirection;
        }
        unsafe { CFLocaleGetLanguageCharacterDirection(iso_lang_code) }
    }

    #[doc(alias = "CFLocaleGetLanguageLineDirection")]
    #[inline]
    pub fn language_line_direction(iso_lang_code: Option<&CFString>) -> CFLocaleLanguageDirection {
        extern "C-unwind" {
            fn CFLocaleGetLanguageLineDirection(
                iso_lang_code: Option<&CFString>,
            ) -> CFLocaleLanguageDirection;
        }
        unsafe { CFLocaleGetLanguageLineDirection(iso_lang_code) }
    }

    #[doc(alias = "CFLocaleCreateComponentsFromLocaleIdentifier")]
    #[cfg(feature = "CFDictionary")]
    #[inline]
    pub fn new_components_from_locale_identifier(
        allocator: Option<&CFAllocator>,
        locale_id: Option<&CFLocaleIdentifier>,
    ) -> Option<CFRetained<CFDictionary>> {
        extern "C-unwind" {
            fn CFLocaleCreateComponentsFromLocaleIdentifier(
                allocator: Option<&CFAllocator>,
                locale_id: Option<&CFLocaleIdentifier>,
            ) -> Option<NonNull<CFDictionary>>;
        }
        let ret = unsafe { CFLocaleCreateComponentsFromLocaleIdentifier(allocator, locale_id) };
        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
    }

    /// # Safety
    ///
    /// - `allocator` might not allow `None`.
    /// - `dictionary` generics must be of the correct type.
    /// - `dictionary` might not allow `None`.
    #[doc(alias = "CFLocaleCreateLocaleIdentifierFromComponents")]
    #[cfg(feature = "CFDictionary")]
    #[inline]
    pub unsafe fn new_locale_identifier_from_components(
        allocator: Option<&CFAllocator>,
        dictionary: Option<&CFDictionary>,
    ) -> Option<CFRetained<CFLocaleIdentifier>> {
        extern "C-unwind" {
            fn CFLocaleCreateLocaleIdentifierFromComponents(
                allocator: Option<&CFAllocator>,
                dictionary: Option<&CFDictionary>,
            ) -> Option<NonNull<CFLocaleIdentifier>>;
        }
        let ret = unsafe { CFLocaleCreateLocaleIdentifierFromComponents(allocator, dictionary) };
        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
    }

    #[doc(alias = "CFLocaleCreate")]
    #[inline]
    pub fn new(
        allocator: Option<&CFAllocator>,
        locale_identifier: Option<&CFLocaleIdentifier>,
    ) -> Option<CFRetained<CFLocale>> {
        extern "C-unwind" {
            fn CFLocaleCreate(
                allocator: Option<&CFAllocator>,
                locale_identifier: Option<&CFLocaleIdentifier>,
            ) -> Option<NonNull<CFLocale>>;
        }
        let ret = unsafe { CFLocaleCreate(allocator, locale_identifier) };
        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
    }

    #[doc(alias = "CFLocaleCreateCopy")]
    #[inline]
    pub fn new_copy(
        allocator: Option<&CFAllocator>,
        locale: Option<&CFLocale>,
    ) -> Option<CFRetained<CFLocale>> {
        extern "C-unwind" {
            fn CFLocaleCreateCopy(
                allocator: Option<&CFAllocator>,
                locale: Option<&CFLocale>,
            ) -> Option<NonNull<CFLocale>>;
        }
        let ret = unsafe { CFLocaleCreateCopy(allocator, locale) };
        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
    }

    #[doc(alias = "CFLocaleGetIdentifier")]
    #[inline]
    pub fn identifier(&self) -> Option<CFRetained<CFLocaleIdentifier>> {
        extern "C-unwind" {
            fn CFLocaleGetIdentifier(locale: &CFLocale) -> Option<NonNull<CFLocaleIdentifier>>;
        }
        let ret = unsafe { CFLocaleGetIdentifier(self) };
        ret.map(|ret| unsafe { CFRetained::retain(ret) })
    }

    #[doc(alias = "CFLocaleGetValue")]
    #[inline]
    pub fn value(&self, key: Option<&CFLocaleKey>) -> Option<CFRetained<CFType>> {
        extern "C-unwind" {
            fn CFLocaleGetValue(
                locale: &CFLocale,
                key: Option<&CFLocaleKey>,
            ) -> Option<NonNull<CFType>>;
        }
        let ret = unsafe { CFLocaleGetValue(self, key) };
        ret.map(|ret| unsafe { CFRetained::retain(ret) })
    }

    #[doc(alias = "CFLocaleCopyDisplayNameForPropertyValue")]
    #[inline]
    pub fn display_name_for_property_value(
        &self,
        key: Option<&CFLocaleKey>,
        value: Option<&CFString>,
    ) -> Option<CFRetained<CFString>> {
        extern "C-unwind" {
            fn CFLocaleCopyDisplayNameForPropertyValue(
                display_locale: &CFLocale,
                key: Option<&CFLocaleKey>,
                value: Option<&CFString>,
            ) -> Option<NonNull<CFString>>;
        }
        let ret = unsafe { CFLocaleCopyDisplayNameForPropertyValue(self, key, value) };
        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
    }
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocalecurrentlocaledidchangenotification?language=objc)
    #[cfg(feature = "CFNotificationCenter")]
    pub static kCFLocaleCurrentLocaleDidChangeNotification: Option<&'static CFNotificationName>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocaleidentifier?language=objc)
    pub static kCFLocaleIdentifier: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocalelanguagecode?language=objc)
    pub static kCFLocaleLanguageCode: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocalecountrycode?language=objc)
    pub static kCFLocaleCountryCode: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocalescriptcode?language=objc)
    pub static kCFLocaleScriptCode: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocalevariantcode?language=objc)
    pub static kCFLocaleVariantCode: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocaleexemplarcharacterset?language=objc)
    pub static kCFLocaleExemplarCharacterSet: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocalecalendaridentifier?language=objc)
    pub static kCFLocaleCalendarIdentifier: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocalecalendar?language=objc)
    pub static kCFLocaleCalendar: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocalecollationidentifier?language=objc)
    pub static kCFLocaleCollationIdentifier: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocaleusesmetricsystem?language=objc)
    pub static kCFLocaleUsesMetricSystem: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocalemeasurementsystem?language=objc)
    pub static kCFLocaleMeasurementSystem: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocaledecimalseparator?language=objc)
    pub static kCFLocaleDecimalSeparator: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocalegroupingseparator?language=objc)
    pub static kCFLocaleGroupingSeparator: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocalecurrencysymbol?language=objc)
    pub static kCFLocaleCurrencySymbol: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocalecurrencycode?language=objc)
    pub static kCFLocaleCurrencyCode: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocalecollatoridentifier?language=objc)
    pub static kCFLocaleCollatorIdentifier: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocalequotationbegindelimiterkey?language=objc)
    pub static kCFLocaleQuotationBeginDelimiterKey: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocalequotationenddelimiterkey?language=objc)
    pub static kCFLocaleQuotationEndDelimiterKey: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocalealternatequotationbegindelimiterkey?language=objc)
    pub static kCFLocaleAlternateQuotationBeginDelimiterKey: Option<&'static CFLocaleKey>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcflocalealternatequotationenddelimiterkey?language=objc)
    pub static kCFLocaleAlternateQuotationEndDelimiterKey: Option<&'static CFLocaleKey>;
}

/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfcalendaridentifier?language=objc)
// NS_TYPED_ENUM
pub type CFCalendarIdentifier = CFString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfgregoriancalendar?language=objc)
    pub static kCFGregorianCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfbuddhistcalendar?language=objc)
    pub static kCFBuddhistCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfchinesecalendar?language=objc)
    pub static kCFChineseCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfhebrewcalendar?language=objc)
    pub static kCFHebrewCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfislamiccalendar?language=objc)
    pub static kCFIslamicCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfislamiccivilcalendar?language=objc)
    pub static kCFIslamicCivilCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfjapanesecalendar?language=objc)
    pub static kCFJapaneseCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfrepublicofchinacalendar?language=objc)
    pub static kCFRepublicOfChinaCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfpersiancalendar?language=objc)
    pub static kCFPersianCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfindiancalendar?language=objc)
    pub static kCFIndianCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfiso8601calendar?language=objc)
    pub static kCFISO8601Calendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfislamictabularcalendar?language=objc)
    pub static kCFIslamicTabularCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfislamicummalquracalendar?language=objc)
    pub static kCFIslamicUmmAlQuraCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfbanglacalendar?language=objc)
    pub static kCFBanglaCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfgujaraticalendar?language=objc)
    pub static kCFGujaratiCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfkannadacalendar?language=objc)
    pub static kCFKannadaCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfmalayalamcalendar?language=objc)
    pub static kCFMalayalamCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfmarathicalendar?language=objc)
    pub static kCFMarathiCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfodiacalendar?language=objc)
    pub static kCFOdiaCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcftamilcalendar?language=objc)
    pub static kCFTamilCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcftelugucalendar?language=objc)
    pub static kCFTeluguCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfvikramcalendar?language=objc)
    pub static kCFVikramCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfdangicalendar?language=objc)
    pub static kCFDangiCalendar: Option<&'static CFCalendarIdentifier>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfvietnamesecalendar?language=objc)
    pub static kCFVietnameseCalendar: Option<&'static CFCalendarIdentifier>;
}

#[deprecated = "renamed to `CFLocale::system`"]
#[inline]
pub extern "C-unwind" fn CFLocaleGetSystem() -> Option<CFRetained<CFLocale>> {
    extern "C-unwind" {
        fn CFLocaleGetSystem() -> Option<NonNull<CFLocale>>;
    }
    let ret = unsafe { CFLocaleGetSystem() };
    ret.map(|ret| unsafe { CFRetained::retain(ret) })
}

#[deprecated = "renamed to `CFLocale::current`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCopyCurrent() -> Option<CFRetained<CFLocale>> {
    extern "C-unwind" {
        fn CFLocaleCopyCurrent() -> Option<NonNull<CFLocale>>;
    }
    let ret = unsafe { CFLocaleCopyCurrent() };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

#[cfg(feature = "CFArray")]
#[deprecated = "renamed to `CFLocale::available_locale_identifiers`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCopyAvailableLocaleIdentifiers() -> Option<CFRetained<CFArray>> {
    extern "C-unwind" {
        fn CFLocaleCopyAvailableLocaleIdentifiers() -> Option<NonNull<CFArray>>;
    }
    let ret = unsafe { CFLocaleCopyAvailableLocaleIdentifiers() };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

#[cfg(feature = "CFArray")]
#[deprecated = "renamed to `CFLocale::iso_language_codes`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCopyISOLanguageCodes() -> Option<CFRetained<CFArray>> {
    extern "C-unwind" {
        fn CFLocaleCopyISOLanguageCodes() -> Option<NonNull<CFArray>>;
    }
    let ret = unsafe { CFLocaleCopyISOLanguageCodes() };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

#[cfg(feature = "CFArray")]
#[deprecated = "renamed to `CFLocale::iso_country_codes`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCopyISOCountryCodes() -> Option<CFRetained<CFArray>> {
    extern "C-unwind" {
        fn CFLocaleCopyISOCountryCodes() -> Option<NonNull<CFArray>>;
    }
    let ret = unsafe { CFLocaleCopyISOCountryCodes() };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

#[cfg(feature = "CFArray")]
#[deprecated = "renamed to `CFLocale::iso_currency_codes`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCopyISOCurrencyCodes() -> Option<CFRetained<CFArray>> {
    extern "C-unwind" {
        fn CFLocaleCopyISOCurrencyCodes() -> Option<NonNull<CFArray>>;
    }
    let ret = unsafe { CFLocaleCopyISOCurrencyCodes() };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

#[cfg(feature = "CFArray")]
#[deprecated = "renamed to `CFLocale::common_iso_currency_codes`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCopyCommonISOCurrencyCodes() -> Option<CFRetained<CFArray>> {
    extern "C-unwind" {
        fn CFLocaleCopyCommonISOCurrencyCodes() -> Option<NonNull<CFArray>>;
    }
    let ret = unsafe { CFLocaleCopyCommonISOCurrencyCodes() };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

#[cfg(feature = "CFArray")]
#[deprecated = "renamed to `CFLocale::preferred_languages`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCopyPreferredLanguages() -> Option<CFRetained<CFArray>> {
    extern "C-unwind" {
        fn CFLocaleCopyPreferredLanguages() -> Option<NonNull<CFArray>>;
    }
    let ret = unsafe { CFLocaleCopyPreferredLanguages() };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

#[deprecated = "renamed to `CFLocale::new_canonical_language_identifier_from_string`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCreateCanonicalLanguageIdentifierFromString(
    allocator: Option<&CFAllocator>,
    locale_identifier: Option<&CFString>,
) -> Option<CFRetained<CFLocaleIdentifier>> {
    extern "C-unwind" {
        fn CFLocaleCreateCanonicalLanguageIdentifierFromString(
            allocator: Option<&CFAllocator>,
            locale_identifier: Option<&CFString>,
        ) -> Option<NonNull<CFLocaleIdentifier>>;
    }
    let ret = unsafe {
        CFLocaleCreateCanonicalLanguageIdentifierFromString(allocator, locale_identifier)
    };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

#[deprecated = "renamed to `CFLocale::new_canonical_locale_identifier_from_string`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCreateCanonicalLocaleIdentifierFromString(
    allocator: Option<&CFAllocator>,
    locale_identifier: Option<&CFString>,
) -> Option<CFRetained<CFLocaleIdentifier>> {
    extern "C-unwind" {
        fn CFLocaleCreateCanonicalLocaleIdentifierFromString(
            allocator: Option<&CFAllocator>,
            locale_identifier: Option<&CFString>,
        ) -> Option<NonNull<CFLocaleIdentifier>>;
    }
    let ret =
        unsafe { CFLocaleCreateCanonicalLocaleIdentifierFromString(allocator, locale_identifier) };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

#[deprecated = "renamed to `CFLocale::new_canonical_locale_identifier_from_script_manager_codes`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(
    allocator: Option<&CFAllocator>,
    lcode: LangCode,
    rcode: RegionCode,
) -> Option<CFRetained<CFLocaleIdentifier>> {
    extern "C-unwind" {
        fn CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(
            allocator: Option<&CFAllocator>,
            lcode: LangCode,
            rcode: RegionCode,
        ) -> Option<NonNull<CFLocaleIdentifier>>;
    }
    let ret = unsafe {
        CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(allocator, lcode, rcode)
    };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

#[deprecated = "renamed to `CFLocale::new_locale_identifier_from_windows_locale_code`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode(
    allocator: Option<&CFAllocator>,
    lcid: u32,
) -> Option<CFRetained<CFLocaleIdentifier>> {
    extern "C-unwind" {
        fn CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode(
            allocator: Option<&CFAllocator>,
            lcid: u32,
        ) -> Option<NonNull<CFLocaleIdentifier>>;
    }
    let ret = unsafe { CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode(allocator, lcid) };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

#[deprecated = "renamed to `CFLocale::windows_locale_code_from_locale_identifier`"]
#[inline]
pub extern "C-unwind" fn CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier(
    locale_identifier: Option<&CFLocaleIdentifier>,
) -> u32 {
    extern "C-unwind" {
        fn CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier(
            locale_identifier: Option<&CFLocaleIdentifier>,
        ) -> u32;
    }
    unsafe { CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier(locale_identifier) }
}

#[deprecated = "renamed to `CFLocale::language_character_direction`"]
#[inline]
pub extern "C-unwind" fn CFLocaleGetLanguageCharacterDirection(
    iso_lang_code: Option<&CFString>,
) -> CFLocaleLanguageDirection {
    extern "C-unwind" {
        fn CFLocaleGetLanguageCharacterDirection(
            iso_lang_code: Option<&CFString>,
        ) -> CFLocaleLanguageDirection;
    }
    unsafe { CFLocaleGetLanguageCharacterDirection(iso_lang_code) }
}

#[deprecated = "renamed to `CFLocale::language_line_direction`"]
#[inline]
pub extern "C-unwind" fn CFLocaleGetLanguageLineDirection(
    iso_lang_code: Option<&CFString>,
) -> CFLocaleLanguageDirection {
    extern "C-unwind" {
        fn CFLocaleGetLanguageLineDirection(
            iso_lang_code: Option<&CFString>,
        ) -> CFLocaleLanguageDirection;
    }
    unsafe { CFLocaleGetLanguageLineDirection(iso_lang_code) }
}

#[cfg(feature = "CFDictionary")]
#[deprecated = "renamed to `CFLocale::new_components_from_locale_identifier`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCreateComponentsFromLocaleIdentifier(
    allocator: Option<&CFAllocator>,
    locale_id: Option<&CFLocaleIdentifier>,
) -> Option<CFRetained<CFDictionary>> {
    extern "C-unwind" {
        fn CFLocaleCreateComponentsFromLocaleIdentifier(
            allocator: Option<&CFAllocator>,
            locale_id: Option<&CFLocaleIdentifier>,
        ) -> Option<NonNull<CFDictionary>>;
    }
    let ret = unsafe { CFLocaleCreateComponentsFromLocaleIdentifier(allocator, locale_id) };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

#[cfg(feature = "CFDictionary")]
#[deprecated = "renamed to `CFLocale::new_locale_identifier_from_components`"]
#[inline]
pub unsafe extern "C-unwind" fn CFLocaleCreateLocaleIdentifierFromComponents(
    allocator: Option<&CFAllocator>,
    dictionary: Option<&CFDictionary>,
) -> Option<CFRetained<CFLocaleIdentifier>> {
    extern "C-unwind" {
        fn CFLocaleCreateLocaleIdentifierFromComponents(
            allocator: Option<&CFAllocator>,
            dictionary: Option<&CFDictionary>,
        ) -> Option<NonNull<CFLocaleIdentifier>>;
    }
    let ret = unsafe { CFLocaleCreateLocaleIdentifierFromComponents(allocator, dictionary) };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

#[deprecated = "renamed to `CFLocale::new`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCreate(
    allocator: Option<&CFAllocator>,
    locale_identifier: Option<&CFLocaleIdentifier>,
) -> Option<CFRetained<CFLocale>> {
    extern "C-unwind" {
        fn CFLocaleCreate(
            allocator: Option<&CFAllocator>,
            locale_identifier: Option<&CFLocaleIdentifier>,
        ) -> Option<NonNull<CFLocale>>;
    }
    let ret = unsafe { CFLocaleCreate(allocator, locale_identifier) };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

#[deprecated = "renamed to `CFLocale::new_copy`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCreateCopy(
    allocator: Option<&CFAllocator>,
    locale: Option<&CFLocale>,
) -> Option<CFRetained<CFLocale>> {
    extern "C-unwind" {
        fn CFLocaleCreateCopy(
            allocator: Option<&CFAllocator>,
            locale: Option<&CFLocale>,
        ) -> Option<NonNull<CFLocale>>;
    }
    let ret = unsafe { CFLocaleCreateCopy(allocator, locale) };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

#[deprecated = "renamed to `CFLocale::identifier`"]
#[inline]
pub extern "C-unwind" fn CFLocaleGetIdentifier(
    locale: &CFLocale,
) -> Option<CFRetained<CFLocaleIdentifier>> {
    extern "C-unwind" {
        fn CFLocaleGetIdentifier(locale: &CFLocale) -> Option<NonNull<CFLocaleIdentifier>>;
    }
    let ret = unsafe { CFLocaleGetIdentifier(locale) };
    ret.map(|ret| unsafe { CFRetained::retain(ret) })
}

#[deprecated = "renamed to `CFLocale::value`"]
#[inline]
pub extern "C-unwind" fn CFLocaleGetValue(
    locale: &CFLocale,
    key: Option<&CFLocaleKey>,
) -> Option<CFRetained<CFType>> {
    extern "C-unwind" {
        fn CFLocaleGetValue(
            locale: &CFLocale,
            key: Option<&CFLocaleKey>,
        ) -> Option<NonNull<CFType>>;
    }
    let ret = unsafe { CFLocaleGetValue(locale, key) };
    ret.map(|ret| unsafe { CFRetained::retain(ret) })
}

#[deprecated = "renamed to `CFLocale::display_name_for_property_value`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCopyDisplayNameForPropertyValue(
    display_locale: &CFLocale,
    key: Option<&CFLocaleKey>,
    value: Option<&CFString>,
) -> Option<CFRetained<CFString>> {
    extern "C-unwind" {
        fn CFLocaleCopyDisplayNameForPropertyValue(
            display_locale: &CFLocale,
            key: Option<&CFLocaleKey>,
            value: Option<&CFString>,
        ) -> Option<NonNull<CFString>>;
    }
    let ret = unsafe { CFLocaleCopyDisplayNameForPropertyValue(display_locale, key, value) };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}