objc2_cloud_kit/generated/
CKSubscription.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/cloudkit/cksubscriptiontype?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct CKSubscriptionType(pub NSInteger);
15impl CKSubscriptionType {
16    #[doc(alias = "CKSubscriptionTypeQuery")]
17    pub const Query: Self = Self(1);
18    #[doc(alias = "CKSubscriptionTypeRecordZone")]
19    pub const RecordZone: Self = Self(2);
20    #[doc(alias = "CKSubscriptionTypeDatabase")]
21    pub const Database: Self = Self(3);
22}
23
24unsafe impl Encode for CKSubscriptionType {
25    const ENCODING: Encoding = NSInteger::ENCODING;
26}
27
28unsafe impl RefEncode for CKSubscriptionType {
29    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32/// [Apple's documentation](https://developer.apple.com/documentation/cloudkit/cksubscriptionid?language=objc)
33pub type CKSubscriptionID = NSString;
34
35extern_class!(
36    /// [Apple's documentation](https://developer.apple.com/documentation/cloudkit/cksubscription?language=objc)
37    #[unsafe(super(NSObject))]
38    #[derive(Debug, PartialEq, Eq, Hash)]
39    pub struct CKSubscription;
40);
41
42extern_conformance!(
43    unsafe impl NSCoding for CKSubscription {}
44);
45
46extern_conformance!(
47    unsafe impl NSCopying for CKSubscription {}
48);
49
50unsafe impl CopyingHelper for CKSubscription {
51    type Result = Self;
52}
53
54extern_conformance!(
55    unsafe impl NSObjectProtocol for CKSubscription {}
56);
57
58extern_conformance!(
59    unsafe impl NSSecureCoding for CKSubscription {}
60);
61
62impl CKSubscription {
63    extern_methods!(
64        #[unsafe(method(init))]
65        #[unsafe(method_family = init)]
66        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
67
68        #[unsafe(method(new))]
69        #[unsafe(method_family = new)]
70        pub unsafe fn new() -> Retained<Self>;
71
72        #[unsafe(method(subscriptionID))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn subscriptionID(&self) -> Retained<CKSubscriptionID>;
75
76        #[unsafe(method(subscriptionType))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn subscriptionType(&self) -> CKSubscriptionType;
79
80        /// Describes the notification that will be sent when the subscription fires.
81        ///
82        ///
83        /// This property must be set to a non-nil value before saving the
84        /// `CKSubscription.`
85        #[unsafe(method(notificationInfo))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn notificationInfo(&self) -> Option<Retained<CKNotificationInfo>>;
88
89        /// Setter for [`notificationInfo`][Self::notificationInfo].
90        ///
91        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
92        #[unsafe(method(setNotificationInfo:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn setNotificationInfo(&self, notification_info: Option<&CKNotificationInfo>);
95    );
96}
97
98/// [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckquerysubscriptionoptions?language=objc)
99// NS_OPTIONS
100#[repr(transparent)]
101#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
102pub struct CKQuerySubscriptionOptions(pub NSUInteger);
103bitflags::bitflags! {
104    impl CKQuerySubscriptionOptions: NSUInteger {
105        #[doc(alias = "CKQuerySubscriptionOptionsFiresOnRecordCreation")]
106        const FiresOnRecordCreation = 1<<0;
107        #[doc(alias = "CKQuerySubscriptionOptionsFiresOnRecordUpdate")]
108        const FiresOnRecordUpdate = 1<<1;
109        #[doc(alias = "CKQuerySubscriptionOptionsFiresOnRecordDeletion")]
110        const FiresOnRecordDeletion = 1<<2;
111        #[doc(alias = "CKQuerySubscriptionOptionsFiresOnce")]
112        const FiresOnce = 1<<3;
113    }
114}
115
116unsafe impl Encode for CKQuerySubscriptionOptions {
117    const ENCODING: Encoding = NSUInteger::ENCODING;
118}
119
120unsafe impl RefEncode for CKQuerySubscriptionOptions {
121    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
122}
123
124extern_class!(
125    /// A subscription that fires whenever a change matching the predicate occurs.
126    ///
127    ///
128    /// `CKQuerySubscriptions`are not supported in a
129    /// `sharedCloudDatabase`
130    ///
131    /// See also [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckquerysubscription?language=objc)
132    #[unsafe(super(CKSubscription, NSObject))]
133    #[derive(Debug, PartialEq, Eq, Hash)]
134    pub struct CKQuerySubscription;
135);
136
137extern_conformance!(
138    unsafe impl NSCoding for CKQuerySubscription {}
139);
140
141extern_conformance!(
142    unsafe impl NSCopying for CKQuerySubscription {}
143);
144
145unsafe impl CopyingHelper for CKQuerySubscription {
146    type Result = Self;
147}
148
149extern_conformance!(
150    unsafe impl NSObjectProtocol for CKQuerySubscription {}
151);
152
153extern_conformance!(
154    unsafe impl NSSecureCoding for CKQuerySubscription {}
155);
156
157impl CKQuerySubscription {
158    extern_methods!(
159        #[cfg(feature = "CKRecord")]
160        #[deprecated]
161        #[unsafe(method(initWithRecordType:predicate:options:))]
162        #[unsafe(method_family = init)]
163        pub unsafe fn initWithRecordType_predicate_options(
164            this: Allocated<Self>,
165            record_type: &CKRecordType,
166            predicate: &NSPredicate,
167            query_subscription_options: CKQuerySubscriptionOptions,
168        ) -> Retained<Self>;
169
170        #[cfg(feature = "CKRecord")]
171        #[unsafe(method(initWithRecordType:predicate:subscriptionID:options:))]
172        #[unsafe(method_family = init)]
173        pub unsafe fn initWithRecordType_predicate_subscriptionID_options(
174            this: Allocated<Self>,
175            record_type: &CKRecordType,
176            predicate: &NSPredicate,
177            subscription_id: &CKSubscriptionID,
178            query_subscription_options: CKQuerySubscriptionOptions,
179        ) -> Retained<Self>;
180
181        /// # Safety
182        ///
183        /// `a_decoder` possibly has further requirements.
184        #[unsafe(method(initWithCoder:))]
185        #[unsafe(method_family = init)]
186        pub unsafe fn initWithCoder(this: Allocated<Self>, a_decoder: &NSCoder) -> Retained<Self>;
187
188        #[cfg(feature = "CKRecord")]
189        /// The record type that this subscription watches
190        #[unsafe(method(recordType))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn recordType(&self) -> Retained<CKRecordType>;
193
194        /// A predicate that determines when the subscription fires.
195        #[unsafe(method(predicate))]
196        #[unsafe(method_family = none)]
197        pub unsafe fn predicate(&self) -> Retained<NSPredicate>;
198
199        #[cfg(feature = "CKRecordZoneID")]
200        /// Optional property.  If set, a query subscription is scoped to only record changes in the indicated zone.
201        /// Query Subscriptions that do not specify a
202        /// `zoneID`are scoped to record changes across all zones in the database.
203        #[unsafe(method(zoneID))]
204        #[unsafe(method_family = none)]
205        pub unsafe fn zoneID(&self) -> Option<Retained<CKRecordZoneID>>;
206
207        #[cfg(feature = "CKRecordZoneID")]
208        /// Setter for [`zoneID`][Self::zoneID].
209        ///
210        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
211        #[unsafe(method(setZoneID:))]
212        #[unsafe(method_family = none)]
213        pub unsafe fn setZoneID(&self, zone_id: Option<&CKRecordZoneID>);
214
215        /// Options flags describing the firing behavior subscription.
216        ///
217        ///
218        /// One of
219        /// `CKQuerySubscriptionOptionsFiresOnRecordCreation,``CKQuerySubscriptionOptionsFiresOnRecordUpdate,`or
220        /// `CKQuerySubscriptionOptionsFiresOnRecordDeletion`must be specified or an
221        /// `NSInvalidArgumentException`will be thrown.
222        #[unsafe(method(querySubscriptionOptions))]
223        #[unsafe(method_family = none)]
224        pub unsafe fn querySubscriptionOptions(&self) -> CKQuerySubscriptionOptions;
225    );
226}
227
228/// Methods declared on superclass `CKSubscription`.
229impl CKQuerySubscription {
230    extern_methods!(
231        #[unsafe(method(init))]
232        #[unsafe(method_family = init)]
233        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
234
235        #[unsafe(method(new))]
236        #[unsafe(method_family = new)]
237        pub unsafe fn new() -> Retained<Self>;
238    );
239}
240
241extern_class!(
242    /// A subscription that fires whenever any change happens in the indicated Record Zone.
243    ///
244    ///
245    /// The RecordZone must have the capability
246    /// `CKRecordZoneCapabilityFetchChanges``CKRecordZoneSubscriptions`are not supported in a
247    /// `sharedCloudDatabase`
248    ///
249    /// See also [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckrecordzonesubscription?language=objc)
250    #[unsafe(super(CKSubscription, NSObject))]
251    #[derive(Debug, PartialEq, Eq, Hash)]
252    pub struct CKRecordZoneSubscription;
253);
254
255extern_conformance!(
256    unsafe impl NSCoding for CKRecordZoneSubscription {}
257);
258
259extern_conformance!(
260    unsafe impl NSCopying for CKRecordZoneSubscription {}
261);
262
263unsafe impl CopyingHelper for CKRecordZoneSubscription {
264    type Result = Self;
265}
266
267extern_conformance!(
268    unsafe impl NSObjectProtocol for CKRecordZoneSubscription {}
269);
270
271extern_conformance!(
272    unsafe impl NSSecureCoding for CKRecordZoneSubscription {}
273);
274
275impl CKRecordZoneSubscription {
276    extern_methods!(
277        #[cfg(feature = "CKRecordZoneID")]
278        #[deprecated]
279        #[unsafe(method(initWithZoneID:))]
280        #[unsafe(method_family = init)]
281        pub unsafe fn initWithZoneID(
282            this: Allocated<Self>,
283            zone_id: &CKRecordZoneID,
284        ) -> Retained<Self>;
285
286        #[cfg(feature = "CKRecordZoneID")]
287        #[unsafe(method(initWithZoneID:subscriptionID:))]
288        #[unsafe(method_family = init)]
289        pub unsafe fn initWithZoneID_subscriptionID(
290            this: Allocated<Self>,
291            zone_id: &CKRecordZoneID,
292            subscription_id: &CKSubscriptionID,
293        ) -> Retained<Self>;
294
295        /// # Safety
296        ///
297        /// `a_decoder` possibly has further requirements.
298        #[unsafe(method(initWithCoder:))]
299        #[unsafe(method_family = init)]
300        pub unsafe fn initWithCoder(this: Allocated<Self>, a_decoder: &NSCoder) -> Retained<Self>;
301
302        #[cfg(feature = "CKRecordZoneID")]
303        #[unsafe(method(zoneID))]
304        #[unsafe(method_family = none)]
305        pub unsafe fn zoneID(&self) -> Retained<CKRecordZoneID>;
306
307        #[cfg(feature = "CKRecord")]
308        /// Optional property. If set, a zone subscription is scoped to record changes for this record type
309        #[unsafe(method(recordType))]
310        #[unsafe(method_family = none)]
311        pub unsafe fn recordType(&self) -> Option<Retained<CKRecordType>>;
312
313        #[cfg(feature = "CKRecord")]
314        /// Setter for [`recordType`][Self::recordType].
315        ///
316        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
317        #[unsafe(method(setRecordType:))]
318        #[unsafe(method_family = none)]
319        pub unsafe fn setRecordType(&self, record_type: Option<&CKRecordType>);
320    );
321}
322
323/// Methods declared on superclass `CKSubscription`.
324impl CKRecordZoneSubscription {
325    extern_methods!(
326        #[unsafe(method(init))]
327        #[unsafe(method_family = init)]
328        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
329
330        #[unsafe(method(new))]
331        #[unsafe(method_family = new)]
332        pub unsafe fn new() -> Retained<Self>;
333    );
334}
335
336extern_class!(
337    /// A subscription fires whenever any change happens in the database that this subscription was saved in.
338    ///
339    ///
340    /// `CKDatabaseSubscription`is only supported in the Private and Shared databases.
341    ///
342    /// See also [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckdatabasesubscription?language=objc)
343    #[unsafe(super(CKSubscription, NSObject))]
344    #[derive(Debug, PartialEq, Eq, Hash)]
345    pub struct CKDatabaseSubscription;
346);
347
348extern_conformance!(
349    unsafe impl NSCoding for CKDatabaseSubscription {}
350);
351
352extern_conformance!(
353    unsafe impl NSCopying for CKDatabaseSubscription {}
354);
355
356unsafe impl CopyingHelper for CKDatabaseSubscription {
357    type Result = Self;
358}
359
360extern_conformance!(
361    unsafe impl NSObjectProtocol for CKDatabaseSubscription {}
362);
363
364extern_conformance!(
365    unsafe impl NSSecureCoding for CKDatabaseSubscription {}
366);
367
368impl CKDatabaseSubscription {
369    extern_methods!(
370        #[deprecated]
371        #[unsafe(method(init))]
372        #[unsafe(method_family = init)]
373        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
374
375        #[unsafe(method(new))]
376        #[unsafe(method_family = new)]
377        pub unsafe fn new() -> Retained<Self>;
378
379        #[unsafe(method(initWithSubscriptionID:))]
380        #[unsafe(method_family = init)]
381        pub unsafe fn initWithSubscriptionID(
382            this: Allocated<Self>,
383            subscription_id: &CKSubscriptionID,
384        ) -> Retained<Self>;
385
386        /// # Safety
387        ///
388        /// `a_decoder` possibly has further requirements.
389        #[unsafe(method(initWithCoder:))]
390        #[unsafe(method_family = init)]
391        pub unsafe fn initWithCoder(this: Allocated<Self>, a_decoder: &NSCoder) -> Retained<Self>;
392
393        #[cfg(feature = "CKRecord")]
394        /// Optional property. If set, a database subscription is scoped to record changes for this record type
395        #[unsafe(method(recordType))]
396        #[unsafe(method_family = none)]
397        pub unsafe fn recordType(&self) -> Option<Retained<CKRecordType>>;
398
399        #[cfg(feature = "CKRecord")]
400        /// Setter for [`recordType`][Self::recordType].
401        ///
402        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
403        #[unsafe(method(setRecordType:))]
404        #[unsafe(method_family = none)]
405        pub unsafe fn setRecordType(&self, record_type: Option<&CKRecordType>);
406    );
407}
408
409extern_class!(
410    /// The payload of a push notification delivered in the UIApplication
411    /// `application:didReceiveRemoteNotification:`delegate method contains information about the firing subscription.
412    ///
413    /// Use
414    ///
415    /// ```text
416    ///  +[CKNotification notificationFromRemoteNotificationDictionary:]
417    /// ```
418    ///
419    /// to parse that payload.
420    /// On tvOS, alerts, badges, sounds, and categories are not handled in push notifications. However, CKSubscriptions remain available to help you avoid polling the server.
421    ///
422    /// See also [Apple's documentation](https://developer.apple.com/documentation/cloudkit/cknotificationinfo?language=objc)
423    #[unsafe(super(NSObject))]
424    #[derive(Debug, PartialEq, Eq, Hash)]
425    pub struct CKNotificationInfo;
426);
427
428extern_conformance!(
429    unsafe impl NSCoding for CKNotificationInfo {}
430);
431
432extern_conformance!(
433    unsafe impl NSCopying for CKNotificationInfo {}
434);
435
436unsafe impl CopyingHelper for CKNotificationInfo {
437    type Result = Self;
438}
439
440extern_conformance!(
441    unsafe impl NSObjectProtocol for CKNotificationInfo {}
442);
443
444extern_conformance!(
445    unsafe impl NSSecureCoding for CKNotificationInfo {}
446);
447
448impl CKNotificationInfo {
449    extern_methods!(
450        /// Optional alert string to display in a push notification.
451        #[unsafe(method(alertBody))]
452        #[unsafe(method_family = none)]
453        pub unsafe fn alertBody(&self) -> Option<Retained<NSString>>;
454
455        /// Setter for [`alertBody`][Self::alertBody].
456        ///
457        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
458        #[unsafe(method(setAlertBody:))]
459        #[unsafe(method_family = none)]
460        pub unsafe fn setAlertBody(&self, alert_body: Option<&NSString>);
461
462        /// Instead of a raw alert string, you may optionally specify a key for a localized string in your app's Localizable.strings file.
463        #[unsafe(method(alertLocalizationKey))]
464        #[unsafe(method_family = none)]
465        pub unsafe fn alertLocalizationKey(&self) -> Option<Retained<NSString>>;
466
467        /// Setter for [`alertLocalizationKey`][Self::alertLocalizationKey].
468        ///
469        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
470        #[unsafe(method(setAlertLocalizationKey:))]
471        #[unsafe(method_family = none)]
472        pub unsafe fn setAlertLocalizationKey(&self, alert_localization_key: Option<&NSString>);
473
474        #[cfg(feature = "CKRecord")]
475        /// A list of field names to take from the matching record that is used as substitution variables in a formatted alert string.
476        #[unsafe(method(alertLocalizationArgs))]
477        #[unsafe(method_family = none)]
478        pub unsafe fn alertLocalizationArgs(&self) -> Option<Retained<NSArray<CKRecordFieldKey>>>;
479
480        #[cfg(feature = "CKRecord")]
481        /// Setter for [`alertLocalizationArgs`][Self::alertLocalizationArgs].
482        ///
483        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
484        #[unsafe(method(setAlertLocalizationArgs:))]
485        #[unsafe(method_family = none)]
486        pub unsafe fn setAlertLocalizationArgs(
487            &self,
488            alert_localization_args: Option<&NSArray<CKRecordFieldKey>>,
489        );
490
491        /// Optional title of the alert to display in a push notification.
492        #[unsafe(method(title))]
493        #[unsafe(method_family = none)]
494        pub unsafe fn title(&self) -> Option<Retained<NSString>>;
495
496        /// Setter for [`title`][Self::title].
497        ///
498        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
499        #[unsafe(method(setTitle:))]
500        #[unsafe(method_family = none)]
501        pub unsafe fn setTitle(&self, title: Option<&NSString>);
502
503        /// Instead of a raw title string, you may optionally specify a key for a localized string in your app's Localizable.strings file.
504        #[unsafe(method(titleLocalizationKey))]
505        #[unsafe(method_family = none)]
506        pub unsafe fn titleLocalizationKey(&self) -> Option<Retained<NSString>>;
507
508        /// Setter for [`titleLocalizationKey`][Self::titleLocalizationKey].
509        ///
510        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
511        #[unsafe(method(setTitleLocalizationKey:))]
512        #[unsafe(method_family = none)]
513        pub unsafe fn setTitleLocalizationKey(&self, title_localization_key: Option<&NSString>);
514
515        #[cfg(feature = "CKRecord")]
516        /// A list of field names to take from the matching record that is used as substitution variables in a formatted title string.
517        #[unsafe(method(titleLocalizationArgs))]
518        #[unsafe(method_family = none)]
519        pub unsafe fn titleLocalizationArgs(&self) -> Option<Retained<NSArray<CKRecordFieldKey>>>;
520
521        #[cfg(feature = "CKRecord")]
522        /// Setter for [`titleLocalizationArgs`][Self::titleLocalizationArgs].
523        ///
524        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
525        #[unsafe(method(setTitleLocalizationArgs:))]
526        #[unsafe(method_family = none)]
527        pub unsafe fn setTitleLocalizationArgs(
528            &self,
529            title_localization_args: Option<&NSArray<CKRecordFieldKey>>,
530        );
531
532        /// Optional subtitle of the alert to display in a push notification.
533        #[unsafe(method(subtitle))]
534        #[unsafe(method_family = none)]
535        pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
536
537        /// Setter for [`subtitle`][Self::subtitle].
538        ///
539        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
540        #[unsafe(method(setSubtitle:))]
541        #[unsafe(method_family = none)]
542        pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>);
543
544        /// Instead of a raw subtitle string, you may optionally specify a key for a localized string in your app's Localizable.strings file.
545        #[unsafe(method(subtitleLocalizationKey))]
546        #[unsafe(method_family = none)]
547        pub unsafe fn subtitleLocalizationKey(&self) -> Option<Retained<NSString>>;
548
549        /// Setter for [`subtitleLocalizationKey`][Self::subtitleLocalizationKey].
550        ///
551        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
552        #[unsafe(method(setSubtitleLocalizationKey:))]
553        #[unsafe(method_family = none)]
554        pub unsafe fn setSubtitleLocalizationKey(
555            &self,
556            subtitle_localization_key: Option<&NSString>,
557        );
558
559        #[cfg(feature = "CKRecord")]
560        /// A list of field names to take from the matching record that is used as substitution variables in a formatted subtitle string.
561        #[unsafe(method(subtitleLocalizationArgs))]
562        #[unsafe(method_family = none)]
563        pub unsafe fn subtitleLocalizationArgs(
564            &self,
565        ) -> Option<Retained<NSArray<CKRecordFieldKey>>>;
566
567        #[cfg(feature = "CKRecord")]
568        /// Setter for [`subtitleLocalizationArgs`][Self::subtitleLocalizationArgs].
569        ///
570        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
571        #[unsafe(method(setSubtitleLocalizationArgs:))]
572        #[unsafe(method_family = none)]
573        pub unsafe fn setSubtitleLocalizationArgs(
574            &self,
575            subtitle_localization_args: Option<&NSArray<CKRecordFieldKey>>,
576        );
577
578        /// A key for a localized string to be used as the alert action in a modal style notification.
579        #[unsafe(method(alertActionLocalizationKey))]
580        #[unsafe(method_family = none)]
581        pub unsafe fn alertActionLocalizationKey(&self) -> Option<Retained<NSString>>;
582
583        /// Setter for [`alertActionLocalizationKey`][Self::alertActionLocalizationKey].
584        ///
585        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
586        #[unsafe(method(setAlertActionLocalizationKey:))]
587        #[unsafe(method_family = none)]
588        pub unsafe fn setAlertActionLocalizationKey(
589            &self,
590            alert_action_localization_key: Option<&NSString>,
591        );
592
593        /// The name of an image in your app bundle to be used as the launch image when launching in response to the notification.
594        #[unsafe(method(alertLaunchImage))]
595        #[unsafe(method_family = none)]
596        pub unsafe fn alertLaunchImage(&self) -> Option<Retained<NSString>>;
597
598        /// Setter for [`alertLaunchImage`][Self::alertLaunchImage].
599        ///
600        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
601        #[unsafe(method(setAlertLaunchImage:))]
602        #[unsafe(method_family = none)]
603        pub unsafe fn setAlertLaunchImage(&self, alert_launch_image: Option<&NSString>);
604
605        /// The name of a sound file in your app bundle to play upon receiving the notification.
606        #[unsafe(method(soundName))]
607        #[unsafe(method_family = none)]
608        pub unsafe fn soundName(&self) -> Option<Retained<NSString>>;
609
610        /// Setter for [`soundName`][Self::soundName].
611        ///
612        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
613        #[unsafe(method(setSoundName:))]
614        #[unsafe(method_family = none)]
615        pub unsafe fn setSoundName(&self, sound_name: Option<&NSString>);
616
617        #[cfg(feature = "CKRecord")]
618        /// A list of keys from the matching record to include in the notification payload.
619        ///
620        ///
621        /// Only some keys are allowed.  The value types associated with those keys on the server must be one of these classes:
622        /// - CKReference
623        /// - CLLocation
624        /// - NSDate
625        /// - NSNumber
626        /// - NSString
627        #[unsafe(method(desiredKeys))]
628        #[unsafe(method_family = none)]
629        pub unsafe fn desiredKeys(&self) -> Option<Retained<NSArray<CKRecordFieldKey>>>;
630
631        #[cfg(feature = "CKRecord")]
632        /// Setter for [`desiredKeys`][Self::desiredKeys].
633        ///
634        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
635        #[unsafe(method(setDesiredKeys:))]
636        #[unsafe(method_family = none)]
637        pub unsafe fn setDesiredKeys(&self, desired_keys: Option<&NSArray<CKRecordFieldKey>>);
638
639        /// Indicates that the notification should increment the app's badge count. Default value is
640        /// `NO.`
641        #[unsafe(method(shouldBadge))]
642        #[unsafe(method_family = none)]
643        pub unsafe fn shouldBadge(&self) -> bool;
644
645        /// Setter for [`shouldBadge`][Self::shouldBadge].
646        #[unsafe(method(setShouldBadge:))]
647        #[unsafe(method_family = none)]
648        pub unsafe fn setShouldBadge(&self, should_badge: bool);
649
650        /// Indicates that the notification should be sent with the "content-available" flag to allow for background downloads in the application.
651        ///
652        ///
653        /// Default value is
654        /// `NO.`
655        #[unsafe(method(shouldSendContentAvailable))]
656        #[unsafe(method_family = none)]
657        pub unsafe fn shouldSendContentAvailable(&self) -> bool;
658
659        /// Setter for [`shouldSendContentAvailable`][Self::shouldSendContentAvailable].
660        #[unsafe(method(setShouldSendContentAvailable:))]
661        #[unsafe(method_family = none)]
662        pub unsafe fn setShouldSendContentAvailable(&self, should_send_content_available: bool);
663
664        /// Indicates that the notification should be sent with the "mutable-content" flag to allow a Notification Service app extension to modify or replace the push payload.
665        ///
666        ///
667        /// Default value is
668        /// `NO.`
669        #[unsafe(method(shouldSendMutableContent))]
670        #[unsafe(method_family = none)]
671        pub unsafe fn shouldSendMutableContent(&self) -> bool;
672
673        /// Setter for [`shouldSendMutableContent`][Self::shouldSendMutableContent].
674        #[unsafe(method(setShouldSendMutableContent:))]
675        #[unsafe(method_family = none)]
676        pub unsafe fn setShouldSendMutableContent(&self, should_send_mutable_content: bool);
677
678        /// Optional property for the category to be sent with the push when this subscription fires.
679        ///
680        ///
681        /// Categories allow you to present custom actions to the user on your push notifications.
682        ///
683        ///
684        /// See: UIMutableUserNotificationCategory
685        #[unsafe(method(category))]
686        #[unsafe(method_family = none)]
687        pub unsafe fn category(&self) -> Option<Retained<NSString>>;
688
689        /// Setter for [`category`][Self::category].
690        ///
691        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
692        #[unsafe(method(setCategory:))]
693        #[unsafe(method_family = none)]
694        pub unsafe fn setCategory(&self, category: Option<&NSString>);
695
696        /// Optional property specifying a field name to take from the matching record whose value is used as the apns-collapse-id header.
697        ///
698        ///
699        /// See: APNs Notification API documentation
700        #[unsafe(method(collapseIDKey))]
701        #[unsafe(method_family = none)]
702        pub unsafe fn collapseIDKey(&self) -> Option<Retained<NSString>>;
703
704        /// Setter for [`collapseIDKey`][Self::collapseIDKey].
705        ///
706        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
707        #[unsafe(method(setCollapseIDKey:))]
708        #[unsafe(method_family = none)]
709        pub unsafe fn setCollapseIDKey(&self, collapse_id_key: Option<&NSString>);
710    );
711}
712
713/// Methods declared on superclass `NSObject`.
714impl CKNotificationInfo {
715    extern_methods!(
716        #[unsafe(method(init))]
717        #[unsafe(method_family = init)]
718        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
719
720        #[unsafe(method(new))]
721        #[unsafe(method_family = new)]
722        pub unsafe fn new() -> Retained<Self>;
723    );
724}