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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::Foundation::*;

typed_enum!(
    pub type NSLocaleKey = NSString;
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Foundation_NSLocale")]
    pub struct NSLocale;

    #[cfg(feature = "Foundation_NSLocale")]
    unsafe impl ClassType for NSLocale {
        type Super = NSObject;
    }
);

#[cfg(feature = "Foundation_NSLocale")]
unsafe impl NSCoding for NSLocale {}

#[cfg(feature = "Foundation_NSLocale")]
unsafe impl NSObjectProtocol for NSLocale {}

#[cfg(feature = "Foundation_NSLocale")]
unsafe impl NSSecureCoding for NSLocale {}

extern_methods!(
    #[cfg(feature = "Foundation_NSLocale")]
    unsafe impl NSLocale {
        #[method_id(@__retain_semantics Other objectForKey:)]
        pub unsafe fn objectForKey(&self, key: &NSLocaleKey) -> Option<Id<Object, Shared>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other displayNameForKey:value:)]
        pub unsafe fn displayNameForKey_value(
            &self,
            key: &NSLocaleKey,
            value: &Object,
        ) -> Option<Id<NSString, Shared>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Init initWithLocaleIdentifier:)]
        pub unsafe fn initWithLocaleIdentifier(
            this: Option<Allocated<Self>>,
            string: &NSString,
        ) -> Id<Self, Shared>;

        #[cfg(feature = "Foundation_NSCoder")]
        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(
            this: Option<Allocated<Self>>,
            coder: &NSCoder,
        ) -> Option<Id<Self, Shared>>;
    }
);

extern_methods!(
    /// NSExtendedLocale
    #[cfg(feature = "Foundation_NSLocale")]
    unsafe impl NSLocale {
        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other localeIdentifier)]
        pub unsafe fn localeIdentifier(&self) -> Id<NSString, Shared>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other localizedStringForLocaleIdentifier:)]
        pub unsafe fn localizedStringForLocaleIdentifier(
            &self,
            locale_identifier: &NSString,
        ) -> Id<NSString, Shared>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other languageCode)]
        pub unsafe fn languageCode(&self) -> Id<NSString, Shared>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other localizedStringForLanguageCode:)]
        pub unsafe fn localizedStringForLanguageCode(
            &self,
            language_code: &NSString,
        ) -> Option<Id<NSString, Shared>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other countryCode)]
        pub unsafe fn countryCode(&self) -> Option<Id<NSString, Shared>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other localizedStringForCountryCode:)]
        pub unsafe fn localizedStringForCountryCode(
            &self,
            country_code: &NSString,
        ) -> Option<Id<NSString, Shared>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other scriptCode)]
        pub unsafe fn scriptCode(&self) -> Option<Id<NSString, Shared>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other localizedStringForScriptCode:)]
        pub unsafe fn localizedStringForScriptCode(
            &self,
            script_code: &NSString,
        ) -> Option<Id<NSString, Shared>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other variantCode)]
        pub unsafe fn variantCode(&self) -> Option<Id<NSString, Shared>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other localizedStringForVariantCode:)]
        pub unsafe fn localizedStringForVariantCode(
            &self,
            variant_code: &NSString,
        ) -> Option<Id<NSString, Shared>>;

        #[cfg(feature = "Foundation_NSCharacterSet")]
        #[method_id(@__retain_semantics Other exemplarCharacterSet)]
        pub unsafe fn exemplarCharacterSet(&self) -> Id<NSCharacterSet, Shared>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other calendarIdentifier)]
        pub unsafe fn calendarIdentifier(&self) -> Id<NSString, Shared>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other localizedStringForCalendarIdentifier:)]
        pub unsafe fn localizedStringForCalendarIdentifier(
            &self,
            calendar_identifier: &NSString,
        ) -> Option<Id<NSString, Shared>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other collationIdentifier)]
        pub unsafe fn collationIdentifier(&self) -> Option<Id<NSString, Shared>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other localizedStringForCollationIdentifier:)]
        pub unsafe fn localizedStringForCollationIdentifier(
            &self,
            collation_identifier: &NSString,
        ) -> Option<Id<NSString, Shared>>;

        #[method(usesMetricSystem)]
        pub unsafe fn usesMetricSystem(&self) -> bool;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other decimalSeparator)]
        pub unsafe fn decimalSeparator(&self) -> Id<NSString, Shared>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other groupingSeparator)]
        pub unsafe fn groupingSeparator(&self) -> Id<NSString, Shared>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other currencySymbol)]
        pub unsafe fn currencySymbol(&self) -> Id<NSString, Shared>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other currencyCode)]
        pub unsafe fn currencyCode(&self) -> Option<Id<NSString, Shared>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other localizedStringForCurrencyCode:)]
        pub unsafe fn localizedStringForCurrencyCode(
            &self,
            currency_code: &NSString,
        ) -> Option<Id<NSString, Shared>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other collatorIdentifier)]
        pub unsafe fn collatorIdentifier(&self) -> Id<NSString, Shared>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other localizedStringForCollatorIdentifier:)]
        pub unsafe fn localizedStringForCollatorIdentifier(
            &self,
            collator_identifier: &NSString,
        ) -> Option<Id<NSString, Shared>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other quotationBeginDelimiter)]
        pub unsafe fn quotationBeginDelimiter(&self) -> Id<NSString, Shared>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other quotationEndDelimiter)]
        pub unsafe fn quotationEndDelimiter(&self) -> Id<NSString, Shared>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other alternateQuotationBeginDelimiter)]
        pub unsafe fn alternateQuotationBeginDelimiter(&self) -> Id<NSString, Shared>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other alternateQuotationEndDelimiter)]
        pub unsafe fn alternateQuotationEndDelimiter(&self) -> Id<NSString, Shared>;
    }
);

extern_methods!(
    /// NSLocaleCreation
    #[cfg(feature = "Foundation_NSLocale")]
    unsafe impl NSLocale {
        #[method_id(@__retain_semantics Other autoupdatingCurrentLocale)]
        pub unsafe fn autoupdatingCurrentLocale() -> Id<NSLocale, Shared>;

        #[method_id(@__retain_semantics Other currentLocale)]
        pub unsafe fn currentLocale() -> Id<NSLocale, Shared>;

        #[method_id(@__retain_semantics Other systemLocale)]
        pub unsafe fn systemLocale() -> Id<NSLocale, Shared>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other localeWithLocaleIdentifier:)]
        pub unsafe fn localeWithLocaleIdentifier(ident: &NSString) -> Id<Self, Shared>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;
    }
);

ns_enum!(
    #[underlying(NSUInteger)]
    pub enum NSLocaleLanguageDirection {
        NSLocaleLanguageDirectionUnknown = 0,
        NSLocaleLanguageDirectionLeftToRight = 1,
        NSLocaleLanguageDirectionRightToLeft = 2,
        NSLocaleLanguageDirectionTopToBottom = 3,
        NSLocaleLanguageDirectionBottomToTop = 4,
    }
);

extern_methods!(
    /// NSLocaleGeneralInfo
    #[cfg(feature = "Foundation_NSLocale")]
    unsafe impl NSLocale {
        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other availableLocaleIdentifiers)]
        pub unsafe fn availableLocaleIdentifiers() -> Id<NSArray<NSString>, Shared>;

        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other ISOLanguageCodes)]
        pub unsafe fn ISOLanguageCodes() -> Id<NSArray<NSString>, Shared>;

        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other ISOCountryCodes)]
        pub unsafe fn ISOCountryCodes() -> Id<NSArray<NSString>, Shared>;

        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other ISOCurrencyCodes)]
        pub unsafe fn ISOCurrencyCodes() -> Id<NSArray<NSString>, Shared>;

        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other commonISOCurrencyCodes)]
        pub unsafe fn commonISOCurrencyCodes() -> Id<NSArray<NSString>, Shared>;

        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other preferredLanguages)]
        pub unsafe fn preferredLanguages() -> Id<NSArray<NSString>, Shared>;

        #[cfg(all(feature = "Foundation_NSDictionary", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other componentsFromLocaleIdentifier:)]
        pub unsafe fn componentsFromLocaleIdentifier(
            string: &NSString,
        ) -> Id<NSDictionary<NSString, NSString>, Shared>;

        #[cfg(all(feature = "Foundation_NSDictionary", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other localeIdentifierFromComponents:)]
        pub unsafe fn localeIdentifierFromComponents(
            dict: &NSDictionary<NSString, NSString>,
        ) -> Id<NSString, Shared>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other canonicalLocaleIdentifierFromString:)]
        pub unsafe fn canonicalLocaleIdentifierFromString(
            string: &NSString,
        ) -> Id<NSString, Shared>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other canonicalLanguageIdentifierFromString:)]
        pub unsafe fn canonicalLanguageIdentifierFromString(
            string: &NSString,
        ) -> Id<NSString, Shared>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other localeIdentifierFromWindowsLocaleCode:)]
        pub unsafe fn localeIdentifierFromWindowsLocaleCode(
            lcid: u32,
        ) -> Option<Id<NSString, Shared>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method(windowsLocaleCodeFromLocaleIdentifier:)]
        pub unsafe fn windowsLocaleCodeFromLocaleIdentifier(locale_identifier: &NSString) -> u32;

        #[cfg(feature = "Foundation_NSString")]
        #[method(characterDirectionForLanguage:)]
        pub unsafe fn characterDirectionForLanguage(
            iso_lang_code: &NSString,
        ) -> NSLocaleLanguageDirection;

        #[cfg(feature = "Foundation_NSString")]
        #[method(lineDirectionForLanguage:)]
        pub unsafe fn lineDirectionForLanguage(
            iso_lang_code: &NSString,
        ) -> NSLocaleLanguageDirection;
    }
);

extern_static!(NSCurrentLocaleDidChangeNotification: &'static NSNotificationName);

extern_static!(NSLocaleIdentifier: &'static NSLocaleKey);

extern_static!(NSLocaleLanguageCode: &'static NSLocaleKey);

extern_static!(NSLocaleCountryCode: &'static NSLocaleKey);

extern_static!(NSLocaleScriptCode: &'static NSLocaleKey);

extern_static!(NSLocaleVariantCode: &'static NSLocaleKey);

extern_static!(NSLocaleExemplarCharacterSet: &'static NSLocaleKey);

extern_static!(NSLocaleCalendar: &'static NSLocaleKey);

extern_static!(NSLocaleCollationIdentifier: &'static NSLocaleKey);

extern_static!(NSLocaleUsesMetricSystem: &'static NSLocaleKey);

extern_static!(NSLocaleMeasurementSystem: &'static NSLocaleKey);

extern_static!(NSLocaleDecimalSeparator: &'static NSLocaleKey);

extern_static!(NSLocaleGroupingSeparator: &'static NSLocaleKey);

extern_static!(NSLocaleCurrencySymbol: &'static NSLocaleKey);

extern_static!(NSLocaleCurrencyCode: &'static NSLocaleKey);

extern_static!(NSLocaleCollatorIdentifier: &'static NSLocaleKey);

extern_static!(NSLocaleQuotationBeginDelimiterKey: &'static NSLocaleKey);

extern_static!(NSLocaleQuotationEndDelimiterKey: &'static NSLocaleKey);

extern_static!(NSLocaleAlternateQuotationBeginDelimiterKey: &'static NSLocaleKey);

extern_static!(NSLocaleAlternateQuotationEndDelimiterKey: &'static NSLocaleKey);

extern_static!(NSGregorianCalendar: &'static NSString);

extern_static!(NSBuddhistCalendar: &'static NSString);

extern_static!(NSChineseCalendar: &'static NSString);

extern_static!(NSHebrewCalendar: &'static NSString);

extern_static!(NSIslamicCalendar: &'static NSString);

extern_static!(NSIslamicCivilCalendar: &'static NSString);

extern_static!(NSJapaneseCalendar: &'static NSString);

extern_static!(NSRepublicOfChinaCalendar: &'static NSString);

extern_static!(NSPersianCalendar: &'static NSString);

extern_static!(NSIndianCalendar: &'static NSString);

extern_static!(NSISO8601Calendar: &'static NSString);