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

use crate::*;

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSGlobalDomain: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSArgumentDomain: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSRegistrationDomain: &'static NSString;
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSUserDefaults;

    unsafe impl ClassType for NSUserDefaults {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for NSUserDefaults {}

extern_methods!(
    unsafe impl NSUserDefaults {
        #[method_id(@__retain_semantics Other standardUserDefaults)]
        pub unsafe fn standardUserDefaults() -> Retained<NSUserDefaults>;

        #[method(resetStandardUserDefaults)]
        pub unsafe fn resetStandardUserDefaults();

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "NSString")]
        #[method_id(@__retain_semantics Init initWithSuiteName:)]
        pub unsafe fn initWithSuiteName(
            this: Allocated<Self>,
            suitename: Option<&NSString>,
        ) -> Option<Retained<Self>>;

        #[cfg(feature = "NSString")]
        #[deprecated = "Use -init instead"]
        #[method_id(@__retain_semantics Init initWithUser:)]
        pub unsafe fn initWithUser(
            this: Allocated<Self>,
            username: &NSString,
        ) -> Option<Retained<Self>>;

        #[cfg(feature = "NSString")]
        #[method_id(@__retain_semantics Other objectForKey:)]
        pub unsafe fn objectForKey(&self, default_name: &NSString) -> Option<Retained<AnyObject>>;

        #[cfg(feature = "NSString")]
        #[method(setObject:forKey:)]
        pub unsafe fn setObject_forKey(&self, value: Option<&AnyObject>, default_name: &NSString);

        #[cfg(feature = "NSString")]
        #[method(removeObjectForKey:)]
        pub unsafe fn removeObjectForKey(&self, default_name: &NSString);

        #[cfg(feature = "NSString")]
        #[method_id(@__retain_semantics Other stringForKey:)]
        pub unsafe fn stringForKey(&self, default_name: &NSString) -> Option<Retained<NSString>>;

        #[cfg(all(feature = "NSArray", feature = "NSString"))]
        #[method_id(@__retain_semantics Other arrayForKey:)]
        pub unsafe fn arrayForKey(&self, default_name: &NSString) -> Option<Retained<NSArray>>;

        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
        #[method_id(@__retain_semantics Other dictionaryForKey:)]
        pub unsafe fn dictionaryForKey(
            &self,
            default_name: &NSString,
        ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;

        #[cfg(all(feature = "NSData", feature = "NSString"))]
        #[method_id(@__retain_semantics Other dataForKey:)]
        pub unsafe fn dataForKey(&self, default_name: &NSString) -> Option<Retained<NSData>>;

        #[cfg(all(feature = "NSArray", feature = "NSString"))]
        #[method_id(@__retain_semantics Other stringArrayForKey:)]
        pub unsafe fn stringArrayForKey(
            &self,
            default_name: &NSString,
        ) -> Option<Retained<NSArray<NSString>>>;

        #[cfg(feature = "NSString")]
        #[method(integerForKey:)]
        pub unsafe fn integerForKey(&self, default_name: &NSString) -> NSInteger;

        #[cfg(feature = "NSString")]
        #[method(floatForKey:)]
        pub unsafe fn floatForKey(&self, default_name: &NSString) -> c_float;

        #[cfg(feature = "NSString")]
        #[method(doubleForKey:)]
        pub unsafe fn doubleForKey(&self, default_name: &NSString) -> c_double;

        #[cfg(feature = "NSString")]
        #[method(boolForKey:)]
        pub unsafe fn boolForKey(&self, default_name: &NSString) -> bool;

        #[cfg(all(feature = "NSString", feature = "NSURL"))]
        #[method_id(@__retain_semantics Other URLForKey:)]
        pub unsafe fn URLForKey(&self, default_name: &NSString) -> Option<Retained<NSURL>>;

        #[cfg(feature = "NSString")]
        #[method(setInteger:forKey:)]
        pub unsafe fn setInteger_forKey(&self, value: NSInteger, default_name: &NSString);

        #[cfg(feature = "NSString")]
        #[method(setFloat:forKey:)]
        pub unsafe fn setFloat_forKey(&self, value: c_float, default_name: &NSString);

        #[cfg(feature = "NSString")]
        #[method(setDouble:forKey:)]
        pub unsafe fn setDouble_forKey(&self, value: c_double, default_name: &NSString);

        #[cfg(feature = "NSString")]
        #[method(setBool:forKey:)]
        pub unsafe fn setBool_forKey(&self, value: bool, default_name: &NSString);

        #[cfg(all(feature = "NSString", feature = "NSURL"))]
        #[method(setURL:forKey:)]
        pub unsafe fn setURL_forKey(&self, url: Option<&NSURL>, default_name: &NSString);

        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
        #[method(registerDefaults:)]
        pub unsafe fn registerDefaults(
            &self,
            registration_dictionary: &NSDictionary<NSString, AnyObject>,
        );

        #[cfg(feature = "NSString")]
        #[method(addSuiteNamed:)]
        pub unsafe fn addSuiteNamed(&self, suite_name: &NSString);

        #[cfg(feature = "NSString")]
        #[method(removeSuiteNamed:)]
        pub unsafe fn removeSuiteNamed(&self, suite_name: &NSString);

        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
        #[method_id(@__retain_semantics Other dictionaryRepresentation)]
        pub unsafe fn dictionaryRepresentation(
            &self,
        ) -> Retained<NSDictionary<NSString, AnyObject>>;

        #[cfg(all(feature = "NSArray", feature = "NSString"))]
        #[method_id(@__retain_semantics Other volatileDomainNames)]
        pub unsafe fn volatileDomainNames(&self) -> Retained<NSArray<NSString>>;

        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
        #[method_id(@__retain_semantics Other volatileDomainForName:)]
        pub unsafe fn volatileDomainForName(
            &self,
            domain_name: &NSString,
        ) -> Retained<NSDictionary<NSString, AnyObject>>;

        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
        #[method(setVolatileDomain:forName:)]
        pub unsafe fn setVolatileDomain_forName(
            &self,
            domain: &NSDictionary<NSString, AnyObject>,
            domain_name: &NSString,
        );

        #[cfg(feature = "NSString")]
        #[method(removeVolatileDomainForName:)]
        pub unsafe fn removeVolatileDomainForName(&self, domain_name: &NSString);

        #[cfg(feature = "NSArray")]
        #[deprecated = "Not recommended"]
        #[method_id(@__retain_semantics Other persistentDomainNames)]
        pub unsafe fn persistentDomainNames(&self) -> Retained<NSArray>;

        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
        #[method_id(@__retain_semantics Other persistentDomainForName:)]
        pub unsafe fn persistentDomainForName(
            &self,
            domain_name: &NSString,
        ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;

        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
        #[method(setPersistentDomain:forName:)]
        pub unsafe fn setPersistentDomain_forName(
            &self,
            domain: &NSDictionary<NSString, AnyObject>,
            domain_name: &NSString,
        );

        #[cfg(feature = "NSString")]
        #[method(removePersistentDomainForName:)]
        pub unsafe fn removePersistentDomainForName(&self, domain_name: &NSString);

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

        #[cfg(feature = "NSString")]
        #[method(objectIsForcedForKey:)]
        pub unsafe fn objectIsForcedForKey(&self, key: &NSString) -> bool;

        #[cfg(feature = "NSString")]
        #[method(objectIsForcedForKey:inDomain:)]
        pub unsafe fn objectIsForcedForKey_inDomain(
            &self,
            key: &NSString,
            domain: &NSString,
        ) -> bool;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSUserDefaults {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern "C" {
    #[cfg(all(feature = "NSNotification", feature = "NSString"))]
    pub static NSUserDefaultsSizeLimitExceededNotification: &'static NSNotificationName;
}

extern "C" {
    #[cfg(all(feature = "NSNotification", feature = "NSString"))]
    pub static NSUbiquitousUserDefaultsNoCloudAccountNotification: &'static NSNotificationName;
}

extern "C" {
    #[cfg(all(feature = "NSNotification", feature = "NSString"))]
    pub static NSUbiquitousUserDefaultsDidChangeAccountsNotification: &'static NSNotificationName;
}

extern "C" {
    #[cfg(all(feature = "NSNotification", feature = "NSString"))]
    pub static NSUbiquitousUserDefaultsCompletedInitialSyncNotification:
        &'static NSNotificationName;
}

extern "C" {
    #[cfg(all(feature = "NSNotification", feature = "NSString"))]
    pub static NSUserDefaultsDidChangeNotification: &'static NSNotificationName;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSWeekDayNameArray: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSShortWeekDayNameArray: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSMonthNameArray: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSShortMonthNameArray: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSTimeFormatString: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSDateFormatString: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSTimeDateFormatString: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSShortTimeDateFormatString: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSCurrencySymbol: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSDecimalSeparator: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSThousandsSeparator: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSDecimalDigits: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSAMPMDesignation: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSHourNameDesignations: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSYearMonthWeekDesignations: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSEarlierTimeDesignations: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSLaterTimeDesignations: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSThisDayDesignations: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSNextDayDesignations: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSNextNextDayDesignations: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSPriorDayDesignations: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSDateTimeOrdering: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSInternationalCurrencyString: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSShortDateFormatString: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSPositiveCurrencyFormatString: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSNegativeCurrencyFormatString: &'static NSString;
}