objc2_cloud_kit/generated/
CKNotification.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 #[unsafe(super(NSObject))]
12 #[derive(Debug, PartialEq, Eq, Hash)]
13 pub struct CKNotificationID;
14);
15
16unsafe impl NSCoding for CKNotificationID {}
17
18unsafe impl NSCopying for CKNotificationID {}
19
20unsafe impl CopyingHelper for CKNotificationID {
21 type Result = Self;
22}
23
24unsafe impl NSObjectProtocol for CKNotificationID {}
25
26unsafe impl NSSecureCoding for CKNotificationID {}
27
28impl CKNotificationID {
29 extern_methods!();
30}
31
32impl CKNotificationID {
34 extern_methods!(
35 #[unsafe(method(init))]
36 #[unsafe(method_family = init)]
37 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
38
39 #[unsafe(method(new))]
40 #[unsafe(method_family = new)]
41 pub unsafe fn new() -> Retained<Self>;
42 );
43}
44
45#[repr(transparent)]
48#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
49pub struct CKNotificationType(pub NSInteger);
50impl CKNotificationType {
51 #[doc(alias = "CKNotificationTypeQuery")]
53 pub const Query: Self = Self(1);
54 #[doc(alias = "CKNotificationTypeRecordZone")]
56 pub const RecordZone: Self = Self(2);
57 #[doc(alias = "CKNotificationTypeReadNotification")]
59 pub const ReadNotification: Self = Self(3);
60 #[doc(alias = "CKNotificationTypeDatabase")]
62 pub const Database: Self = Self(4);
63}
64
65unsafe impl Encode for CKNotificationType {
66 const ENCODING: Encoding = NSInteger::ENCODING;
67}
68
69unsafe impl RefEncode for CKNotificationType {
70 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
71}
72
73extern_class!(
74 #[unsafe(super(NSObject))]
102 #[derive(Debug, PartialEq, Eq, Hash)]
103 pub struct CKNotification;
104);
105
106unsafe impl Send for CKNotification {}
107
108unsafe impl Sync for CKNotification {}
109
110unsafe impl NSObjectProtocol for CKNotification {}
111
112impl CKNotification {
113 extern_methods!(
114 #[unsafe(method(init))]
115 #[unsafe(method_family = init)]
116 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
117
118 #[unsafe(method(new))]
119 #[unsafe(method_family = new)]
120 pub unsafe fn new() -> Retained<Self>;
121
122 #[unsafe(method(notificationFromRemoteNotificationDictionary:))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn notificationFromRemoteNotificationDictionary(
125 notification_dictionary: &NSDictionary,
126 ) -> Option<Retained<Self>>;
127
128 #[unsafe(method(notificationType))]
131 #[unsafe(method_family = none)]
132 pub unsafe fn notificationType(&self) -> CKNotificationType;
133
134 #[unsafe(method(notificationID))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn notificationID(&self) -> Option<Retained<CKNotificationID>>;
137
138 #[unsafe(method(containerIdentifier))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn containerIdentifier(&self) -> Option<Retained<NSString>>;
141
142 #[cfg(feature = "CKRecordID")]
143 #[unsafe(method(subscriptionOwnerUserRecordID))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn subscriptionOwnerUserRecordID(&self) -> Option<Retained<CKRecordID>>;
147
148 #[unsafe(method(isPruned))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn isPruned(&self) -> bool;
156
157 #[cfg(feature = "CKSubscription")]
158 #[unsafe(method(subscriptionID))]
160 #[unsafe(method_family = none)]
161 pub unsafe fn subscriptionID(&self) -> Option<Retained<CKSubscriptionID>>;
162 );
163}
164
165impl CKNotification {
167 extern_methods!(
168 #[deprecated = "Interact with UI elements of a CloudKit-server-generated push message via UserNotifications.framework"]
169 #[unsafe(method(alertBody))]
170 #[unsafe(method_family = none)]
171 pub unsafe fn alertBody(&self) -> Option<Retained<NSString>>;
172
173 #[deprecated = "Interact with UI elements of a CloudKit-server-generated push message via UserNotifications.framework"]
174 #[unsafe(method(alertLocalizationKey))]
175 #[unsafe(method_family = none)]
176 pub unsafe fn alertLocalizationKey(&self) -> Option<Retained<NSString>>;
177
178 #[deprecated = "Interact with UI elements of a CloudKit-server-generated push message via UserNotifications.framework"]
179 #[unsafe(method(alertLocalizationArgs))]
180 #[unsafe(method_family = none)]
181 pub unsafe fn alertLocalizationArgs(&self) -> Option<Retained<NSArray<NSString>>>;
182
183 #[unsafe(method(title))]
184 #[unsafe(method_family = none)]
185 pub unsafe fn title(&self) -> Option<Retained<NSString>>;
186
187 #[unsafe(method(titleLocalizationKey))]
188 #[unsafe(method_family = none)]
189 pub unsafe fn titleLocalizationKey(&self) -> Option<Retained<NSString>>;
190
191 #[unsafe(method(titleLocalizationArgs))]
192 #[unsafe(method_family = none)]
193 pub unsafe fn titleLocalizationArgs(&self) -> Option<Retained<NSArray<NSString>>>;
194
195 #[unsafe(method(subtitle))]
196 #[unsafe(method_family = none)]
197 pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
198
199 #[unsafe(method(subtitleLocalizationKey))]
200 #[unsafe(method_family = none)]
201 pub unsafe fn subtitleLocalizationKey(&self) -> Option<Retained<NSString>>;
202
203 #[unsafe(method(subtitleLocalizationArgs))]
204 #[unsafe(method_family = none)]
205 pub unsafe fn subtitleLocalizationArgs(&self) -> Option<Retained<NSArray<NSString>>>;
206
207 #[deprecated = "Interact with UI elements of a CloudKit-server-generated push message via UserNotifications.framework"]
208 #[unsafe(method(alertActionLocalizationKey))]
209 #[unsafe(method_family = none)]
210 pub unsafe fn alertActionLocalizationKey(&self) -> Option<Retained<NSString>>;
211
212 #[deprecated = "Interact with UI elements of a CloudKit-server-generated push message via UserNotifications.framework"]
213 #[unsafe(method(alertLaunchImage))]
214 #[unsafe(method_family = none)]
215 pub unsafe fn alertLaunchImage(&self) -> Option<Retained<NSString>>;
216
217 #[deprecated = "Interact with UI elements of a CloudKit-server-generated push message via UserNotifications.framework"]
218 #[unsafe(method(badge))]
219 #[unsafe(method_family = none)]
220 pub unsafe fn badge(&self) -> Option<Retained<NSNumber>>;
221
222 #[deprecated = "Interact with UI elements of a CloudKit-server-generated push message via UserNotifications.framework"]
223 #[unsafe(method(soundName))]
224 #[unsafe(method_family = none)]
225 pub unsafe fn soundName(&self) -> Option<Retained<NSString>>;
226
227 #[unsafe(method(category))]
228 #[unsafe(method_family = none)]
229 pub unsafe fn category(&self) -> Option<Retained<NSString>>;
230 );
231}
232
233#[repr(transparent)]
236#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
237pub struct CKQueryNotificationReason(pub NSInteger);
238impl CKQueryNotificationReason {
239 #[doc(alias = "CKQueryNotificationReasonRecordCreated")]
240 pub const RecordCreated: Self = Self(1);
241 #[doc(alias = "CKQueryNotificationReasonRecordUpdated")]
242 pub const RecordUpdated: Self = Self(2);
243 #[doc(alias = "CKQueryNotificationReasonRecordDeleted")]
244 pub const RecordDeleted: Self = Self(3);
245}
246
247unsafe impl Encode for CKQueryNotificationReason {
248 const ENCODING: Encoding = NSInteger::ENCODING;
249}
250
251unsafe impl RefEncode for CKQueryNotificationReason {
252 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
253}
254
255extern_class!(
256 #[unsafe(super(CKNotification, NSObject))]
284 #[derive(Debug, PartialEq, Eq, Hash)]
285 pub struct CKQueryNotification;
286);
287
288unsafe impl Send for CKQueryNotification {}
289
290unsafe impl Sync for CKQueryNotification {}
291
292unsafe impl NSObjectProtocol for CKQueryNotification {}
293
294impl CKQueryNotification {
295 extern_methods!(
296 #[unsafe(method(queryNotificationReason))]
297 #[unsafe(method_family = none)]
298 pub unsafe fn queryNotificationReason(&self) -> CKQueryNotificationReason;
299
300 #[unsafe(method(recordFields))]
304 #[unsafe(method_family = none)]
305 pub unsafe fn recordFields(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
306
307 #[cfg(feature = "CKRecordID")]
308 #[unsafe(method(recordID))]
309 #[unsafe(method_family = none)]
310 pub unsafe fn recordID(&self) -> Option<Retained<CKRecordID>>;
311
312 #[cfg(feature = "CKDatabase")]
313 #[unsafe(method(databaseScope))]
314 #[unsafe(method_family = none)]
315 pub unsafe fn databaseScope(&self) -> CKDatabaseScope;
316 );
317}
318
319impl CKQueryNotification {
321 extern_methods!(
322 #[unsafe(method(init))]
323 #[unsafe(method_family = init)]
324 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
325
326 #[unsafe(method(new))]
327 #[unsafe(method_family = new)]
328 pub unsafe fn new() -> Retained<Self>;
329
330 #[unsafe(method(notificationFromRemoteNotificationDictionary:))]
331 #[unsafe(method_family = none)]
332 pub unsafe fn notificationFromRemoteNotificationDictionary(
333 notification_dictionary: &NSDictionary,
334 ) -> Option<Retained<Self>>;
335 );
336}
337
338extern_class!(
339 #[unsafe(super(CKNotification, NSObject))]
365 #[derive(Debug, PartialEq, Eq, Hash)]
366 pub struct CKRecordZoneNotification;
367);
368
369unsafe impl Send for CKRecordZoneNotification {}
370
371unsafe impl Sync for CKRecordZoneNotification {}
372
373unsafe impl NSObjectProtocol for CKRecordZoneNotification {}
374
375impl CKRecordZoneNotification {
376 extern_methods!(
377 #[cfg(feature = "CKRecordZoneID")]
378 #[unsafe(method(recordZoneID))]
379 #[unsafe(method_family = none)]
380 pub unsafe fn recordZoneID(&self) -> Option<Retained<CKRecordZoneID>>;
381
382 #[cfg(feature = "CKDatabase")]
383 #[unsafe(method(databaseScope))]
384 #[unsafe(method_family = none)]
385 pub unsafe fn databaseScope(&self) -> CKDatabaseScope;
386 );
387}
388
389impl CKRecordZoneNotification {
391 extern_methods!(
392 #[unsafe(method(init))]
393 #[unsafe(method_family = init)]
394 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
395
396 #[unsafe(method(new))]
397 #[unsafe(method_family = new)]
398 pub unsafe fn new() -> Retained<Self>;
399
400 #[unsafe(method(notificationFromRemoteNotificationDictionary:))]
401 #[unsafe(method_family = none)]
402 pub unsafe fn notificationFromRemoteNotificationDictionary(
403 notification_dictionary: &NSDictionary,
404 ) -> Option<Retained<Self>>;
405 );
406}
407
408extern_class!(
409 #[unsafe(super(CKNotification, NSObject))]
434 #[derive(Debug, PartialEq, Eq, Hash)]
435 pub struct CKDatabaseNotification;
436);
437
438unsafe impl Send for CKDatabaseNotification {}
439
440unsafe impl Sync for CKDatabaseNotification {}
441
442unsafe impl NSObjectProtocol for CKDatabaseNotification {}
443
444impl CKDatabaseNotification {
445 extern_methods!(
446 #[cfg(feature = "CKDatabase")]
447 #[unsafe(method(databaseScope))]
448 #[unsafe(method_family = none)]
449 pub unsafe fn databaseScope(&self) -> CKDatabaseScope;
450 );
451}
452
453impl CKDatabaseNotification {
455 extern_methods!(
456 #[unsafe(method(init))]
457 #[unsafe(method_family = init)]
458 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
459
460 #[unsafe(method(new))]
461 #[unsafe(method_family = new)]
462 pub unsafe fn new() -> Retained<Self>;
463
464 #[unsafe(method(notificationFromRemoteNotificationDictionary:))]
465 #[unsafe(method_family = none)]
466 pub unsafe fn notificationFromRemoteNotificationDictionary(
467 notification_dictionary: &NSDictionary,
468 ) -> Option<Retained<Self>>;
469 );
470}