icrate 0.1.2

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

ns_enum!(
    #[underlying(NSInteger)]
    pub enum CKSubscriptionType {
        CKSubscriptionTypeQuery = 1,
        CKSubscriptionTypeRecordZone = 2,
        CKSubscriptionTypeDatabase = 3,
    }
);

pub type CKSubscriptionID = NSString;

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

    #[cfg(feature = "CloudKit_CKSubscription")]
    unsafe impl ClassType for CKSubscription {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "CloudKit_CKSubscription")]
unsafe impl NSCoding for CKSubscription {}

#[cfg(feature = "CloudKit_CKSubscription")]
unsafe impl NSCopying for CKSubscription {}

#[cfg(feature = "CloudKit_CKSubscription")]
unsafe impl NSObjectProtocol for CKSubscription {}

#[cfg(feature = "CloudKit_CKSubscription")]
unsafe impl NSSecureCoding for CKSubscription {}

extern_methods!(
    #[cfg(feature = "CloudKit_CKSubscription")]
    unsafe impl CKSubscription {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;

        #[method_id(@__retain_semantics Other subscriptionID)]
        pub unsafe fn subscriptionID(&self) -> Id<CKSubscriptionID>;

        #[method(subscriptionType)]
        pub unsafe fn subscriptionType(&self) -> CKSubscriptionType;

        #[cfg(feature = "CloudKit_CKNotificationInfo")]
        #[method_id(@__retain_semantics Other notificationInfo)]
        pub unsafe fn notificationInfo(&self) -> Option<Id<CKNotificationInfo>>;

        #[cfg(feature = "CloudKit_CKNotificationInfo")]
        #[method(setNotificationInfo:)]
        pub unsafe fn setNotificationInfo(&self, notification_info: Option<&CKNotificationInfo>);
    }
);

ns_options!(
    #[underlying(NSUInteger)]
    pub enum CKQuerySubscriptionOptions {
        CKQuerySubscriptionOptionsFiresOnRecordCreation = 1 << 0,
        CKQuerySubscriptionOptionsFiresOnRecordUpdate = 1 << 1,
        CKQuerySubscriptionOptionsFiresOnRecordDeletion = 1 << 2,
        CKQuerySubscriptionOptionsFiresOnce = 1 << 3,
    }
);

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

    #[cfg(feature = "CloudKit_CKQuerySubscription")]
    unsafe impl ClassType for CKQuerySubscription {
        #[inherits(NSObject)]
        type Super = CKSubscription;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "CloudKit_CKQuerySubscription")]
unsafe impl NSCoding for CKQuerySubscription {}

#[cfg(feature = "CloudKit_CKQuerySubscription")]
unsafe impl NSCopying for CKQuerySubscription {}

#[cfg(feature = "CloudKit_CKQuerySubscription")]
unsafe impl NSObjectProtocol for CKQuerySubscription {}

#[cfg(feature = "CloudKit_CKQuerySubscription")]
unsafe impl NSSecureCoding for CKQuerySubscription {}

extern_methods!(
    #[cfg(feature = "CloudKit_CKQuerySubscription")]
    unsafe impl CKQuerySubscription {
        #[cfg(feature = "Foundation_NSPredicate")]
        #[deprecated]
        #[method_id(@__retain_semantics Init initWithRecordType:predicate:options:)]
        pub unsafe fn initWithRecordType_predicate_options(
            this: Allocated<Self>,
            record_type: &CKRecordType,
            predicate: &NSPredicate,
            query_subscription_options: CKQuerySubscriptionOptions,
        ) -> Id<Self>;

        #[cfg(feature = "Foundation_NSPredicate")]
        #[method_id(@__retain_semantics Init initWithRecordType:predicate:subscriptionID:options:)]
        pub unsafe fn initWithRecordType_predicate_subscriptionID_options(
            this: Allocated<Self>,
            record_type: &CKRecordType,
            predicate: &NSPredicate,
            subscription_id: &CKSubscriptionID,
            query_subscription_options: CKQuerySubscriptionOptions,
        ) -> Id<Self>;

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

        #[method_id(@__retain_semantics Other recordType)]
        pub unsafe fn recordType(&self) -> Id<CKRecordType>;

        #[cfg(feature = "Foundation_NSPredicate")]
        #[method_id(@__retain_semantics Other predicate)]
        pub unsafe fn predicate(&self) -> Id<NSPredicate>;

        #[cfg(feature = "CloudKit_CKRecordZoneID")]
        #[method_id(@__retain_semantics Other zoneID)]
        pub unsafe fn zoneID(&self) -> Option<Id<CKRecordZoneID>>;

        #[cfg(feature = "CloudKit_CKRecordZoneID")]
        #[method(setZoneID:)]
        pub unsafe fn setZoneID(&self, zone_id: Option<&CKRecordZoneID>);

        #[method(querySubscriptionOptions)]
        pub unsafe fn querySubscriptionOptions(&self) -> CKQuerySubscriptionOptions;
    }
);

extern_methods!(
    /// Methods declared on superclass `CKSubscription`
    #[cfg(feature = "CloudKit_CKQuerySubscription")]
    unsafe impl CKQuerySubscription {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

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

    #[cfg(feature = "CloudKit_CKRecordZoneSubscription")]
    unsafe impl ClassType for CKRecordZoneSubscription {
        #[inherits(NSObject)]
        type Super = CKSubscription;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "CloudKit_CKRecordZoneSubscription")]
unsafe impl NSCoding for CKRecordZoneSubscription {}

#[cfg(feature = "CloudKit_CKRecordZoneSubscription")]
unsafe impl NSCopying for CKRecordZoneSubscription {}

#[cfg(feature = "CloudKit_CKRecordZoneSubscription")]
unsafe impl NSObjectProtocol for CKRecordZoneSubscription {}

#[cfg(feature = "CloudKit_CKRecordZoneSubscription")]
unsafe impl NSSecureCoding for CKRecordZoneSubscription {}

extern_methods!(
    #[cfg(feature = "CloudKit_CKRecordZoneSubscription")]
    unsafe impl CKRecordZoneSubscription {
        #[cfg(feature = "CloudKit_CKRecordZoneID")]
        #[deprecated]
        #[method_id(@__retain_semantics Init initWithZoneID:)]
        pub unsafe fn initWithZoneID(this: Allocated<Self>, zone_id: &CKRecordZoneID) -> Id<Self>;

        #[cfg(feature = "CloudKit_CKRecordZoneID")]
        #[method_id(@__retain_semantics Init initWithZoneID:subscriptionID:)]
        pub unsafe fn initWithZoneID_subscriptionID(
            this: Allocated<Self>,
            zone_id: &CKRecordZoneID,
            subscription_id: &CKSubscriptionID,
        ) -> Id<Self>;

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

        #[cfg(feature = "CloudKit_CKRecordZoneID")]
        #[method_id(@__retain_semantics Other zoneID)]
        pub unsafe fn zoneID(&self) -> Id<CKRecordZoneID>;

        #[method_id(@__retain_semantics Other recordType)]
        pub unsafe fn recordType(&self) -> Option<Id<CKRecordType>>;

        #[method(setRecordType:)]
        pub unsafe fn setRecordType(&self, record_type: Option<&CKRecordType>);
    }
);

extern_methods!(
    /// Methods declared on superclass `CKSubscription`
    #[cfg(feature = "CloudKit_CKRecordZoneSubscription")]
    unsafe impl CKRecordZoneSubscription {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

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

    #[cfg(feature = "CloudKit_CKDatabaseSubscription")]
    unsafe impl ClassType for CKDatabaseSubscription {
        #[inherits(NSObject)]
        type Super = CKSubscription;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "CloudKit_CKDatabaseSubscription")]
unsafe impl NSCoding for CKDatabaseSubscription {}

#[cfg(feature = "CloudKit_CKDatabaseSubscription")]
unsafe impl NSCopying for CKDatabaseSubscription {}

#[cfg(feature = "CloudKit_CKDatabaseSubscription")]
unsafe impl NSObjectProtocol for CKDatabaseSubscription {}

#[cfg(feature = "CloudKit_CKDatabaseSubscription")]
unsafe impl NSSecureCoding for CKDatabaseSubscription {}

extern_methods!(
    #[cfg(feature = "CloudKit_CKDatabaseSubscription")]
    unsafe impl CKDatabaseSubscription {
        #[deprecated]
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;

        #[method_id(@__retain_semantics Init initWithSubscriptionID:)]
        pub unsafe fn initWithSubscriptionID(
            this: Allocated<Self>,
            subscription_id: &CKSubscriptionID,
        ) -> Id<Self>;

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

        #[method_id(@__retain_semantics Other recordType)]
        pub unsafe fn recordType(&self) -> Option<Id<CKRecordType>>;

        #[method(setRecordType:)]
        pub unsafe fn setRecordType(&self, record_type: Option<&CKRecordType>);
    }
);

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

    #[cfg(feature = "CloudKit_CKNotificationInfo")]
    unsafe impl ClassType for CKNotificationInfo {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "CloudKit_CKNotificationInfo")]
unsafe impl NSCoding for CKNotificationInfo {}

#[cfg(feature = "CloudKit_CKNotificationInfo")]
unsafe impl NSCopying for CKNotificationInfo {}

#[cfg(feature = "CloudKit_CKNotificationInfo")]
unsafe impl NSObjectProtocol for CKNotificationInfo {}

#[cfg(feature = "CloudKit_CKNotificationInfo")]
unsafe impl NSSecureCoding for CKNotificationInfo {}

extern_methods!(
    #[cfg(feature = "CloudKit_CKNotificationInfo")]
    unsafe impl CKNotificationInfo {
        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other alertBody)]
        pub unsafe fn alertBody(&self) -> Option<Id<NSString>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method(setAlertBody:)]
        pub unsafe fn setAlertBody(&self, alert_body: Option<&NSString>);

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

        #[cfg(feature = "Foundation_NSString")]
        #[method(setAlertLocalizationKey:)]
        pub unsafe fn setAlertLocalizationKey(&self, alert_localization_key: Option<&NSString>);

        #[cfg(feature = "Foundation_NSArray")]
        #[method_id(@__retain_semantics Other alertLocalizationArgs)]
        pub unsafe fn alertLocalizationArgs(&self) -> Option<Id<NSArray<CKRecordFieldKey>>>;

        #[cfg(feature = "Foundation_NSArray")]
        #[method(setAlertLocalizationArgs:)]
        pub unsafe fn setAlertLocalizationArgs(
            &self,
            alert_localization_args: Option<&NSArray<CKRecordFieldKey>>,
        );

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

        #[cfg(feature = "Foundation_NSString")]
        #[method(setTitle:)]
        pub unsafe fn setTitle(&self, title: Option<&NSString>);

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

        #[cfg(feature = "Foundation_NSString")]
        #[method(setTitleLocalizationKey:)]
        pub unsafe fn setTitleLocalizationKey(&self, title_localization_key: Option<&NSString>);

        #[cfg(feature = "Foundation_NSArray")]
        #[method_id(@__retain_semantics Other titleLocalizationArgs)]
        pub unsafe fn titleLocalizationArgs(&self) -> Option<Id<NSArray<CKRecordFieldKey>>>;

        #[cfg(feature = "Foundation_NSArray")]
        #[method(setTitleLocalizationArgs:)]
        pub unsafe fn setTitleLocalizationArgs(
            &self,
            title_localization_args: Option<&NSArray<CKRecordFieldKey>>,
        );

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

        #[cfg(feature = "Foundation_NSString")]
        #[method(setSubtitle:)]
        pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>);

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

        #[cfg(feature = "Foundation_NSString")]
        #[method(setSubtitleLocalizationKey:)]
        pub unsafe fn setSubtitleLocalizationKey(
            &self,
            subtitle_localization_key: Option<&NSString>,
        );

        #[cfg(feature = "Foundation_NSArray")]
        #[method_id(@__retain_semantics Other subtitleLocalizationArgs)]
        pub unsafe fn subtitleLocalizationArgs(&self) -> Option<Id<NSArray<CKRecordFieldKey>>>;

        #[cfg(feature = "Foundation_NSArray")]
        #[method(setSubtitleLocalizationArgs:)]
        pub unsafe fn setSubtitleLocalizationArgs(
            &self,
            subtitle_localization_args: Option<&NSArray<CKRecordFieldKey>>,
        );

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

        #[cfg(feature = "Foundation_NSString")]
        #[method(setAlertActionLocalizationKey:)]
        pub unsafe fn setAlertActionLocalizationKey(
            &self,
            alert_action_localization_key: Option<&NSString>,
        );

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

        #[cfg(feature = "Foundation_NSString")]
        #[method(setAlertLaunchImage:)]
        pub unsafe fn setAlertLaunchImage(&self, alert_launch_image: Option<&NSString>);

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

        #[cfg(feature = "Foundation_NSString")]
        #[method(setSoundName:)]
        pub unsafe fn setSoundName(&self, sound_name: Option<&NSString>);

        #[cfg(feature = "Foundation_NSArray")]
        #[method_id(@__retain_semantics Other desiredKeys)]
        pub unsafe fn desiredKeys(&self) -> Option<Id<NSArray<CKRecordFieldKey>>>;

        #[cfg(feature = "Foundation_NSArray")]
        #[method(setDesiredKeys:)]
        pub unsafe fn setDesiredKeys(&self, desired_keys: Option<&NSArray<CKRecordFieldKey>>);

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

        #[method(setShouldBadge:)]
        pub unsafe fn setShouldBadge(&self, should_badge: bool);

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

        #[method(setShouldSendContentAvailable:)]
        pub unsafe fn setShouldSendContentAvailable(&self, should_send_content_available: bool);

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

        #[method(setShouldSendMutableContent:)]
        pub unsafe fn setShouldSendMutableContent(&self, should_send_mutable_content: bool);

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

        #[cfg(feature = "Foundation_NSString")]
        #[method(setCategory:)]
        pub unsafe fn setCategory(&self, category: Option<&NSString>);

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

        #[cfg(feature = "Foundation_NSString")]
        #[method(setCollapseIDKey:)]
        pub unsafe fn setCollapseIDKey(&self, collapse_id_key: Option<&NSString>);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "CloudKit_CKNotificationInfo")]
    unsafe impl CKNotificationInfo {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);