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
16extern_conformance!(
17 unsafe impl NSCoding for CKNotificationID {}
18);
19
20extern_conformance!(
21 unsafe impl NSCopying for CKNotificationID {}
22);
23
24unsafe impl CopyingHelper for CKNotificationID {
25 type Result = Self;
26}
27
28extern_conformance!(
29 unsafe impl NSObjectProtocol for CKNotificationID {}
30);
31
32extern_conformance!(
33 unsafe impl NSSecureCoding for CKNotificationID {}
34);
35
36impl CKNotificationID {
37 extern_methods!();
38}
39
40impl CKNotificationID {
42 extern_methods!(
43 #[unsafe(method(init))]
44 #[unsafe(method_family = init)]
45 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
46
47 #[unsafe(method(new))]
48 #[unsafe(method_family = new)]
49 pub unsafe fn new() -> Retained<Self>;
50 );
51}
52
53#[repr(transparent)]
56#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
57pub struct CKNotificationType(pub NSInteger);
58impl CKNotificationType {
59 #[doc(alias = "CKNotificationTypeQuery")]
61 pub const Query: Self = Self(1);
62 #[doc(alias = "CKNotificationTypeRecordZone")]
64 pub const RecordZone: Self = Self(2);
65 #[doc(alias = "CKNotificationTypeReadNotification")]
67 pub const ReadNotification: Self = Self(3);
68 #[doc(alias = "CKNotificationTypeDatabase")]
70 pub const Database: Self = Self(4);
71}
72
73unsafe impl Encode for CKNotificationType {
74 const ENCODING: Encoding = NSInteger::ENCODING;
75}
76
77unsafe impl RefEncode for CKNotificationType {
78 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
79}
80
81extern_class!(
82 #[unsafe(super(NSObject))]
110 #[derive(Debug, PartialEq, Eq, Hash)]
111 pub struct CKNotification;
112);
113
114unsafe impl Send for CKNotification {}
115
116unsafe impl Sync for CKNotification {}
117
118extern_conformance!(
119 unsafe impl NSObjectProtocol for CKNotification {}
120);
121
122impl CKNotification {
123 extern_methods!(
124 #[unsafe(method(init))]
125 #[unsafe(method_family = init)]
126 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
127
128 #[unsafe(method(new))]
129 #[unsafe(method_family = new)]
130 pub unsafe fn new() -> Retained<Self>;
131
132 #[unsafe(method(notificationFromRemoteNotificationDictionary:))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn notificationFromRemoteNotificationDictionary(
135 notification_dictionary: &NSDictionary,
136 ) -> Option<Retained<Self>>;
137
138 #[unsafe(method(notificationType))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn notificationType(&self) -> CKNotificationType;
143
144 #[unsafe(method(notificationID))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn notificationID(&self) -> Option<Retained<CKNotificationID>>;
147
148 #[unsafe(method(containerIdentifier))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn containerIdentifier(&self) -> Option<Retained<NSString>>;
151
152 #[cfg(feature = "CKRecordID")]
153 #[unsafe(method(subscriptionOwnerUserRecordID))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn subscriptionOwnerUserRecordID(&self) -> Option<Retained<CKRecordID>>;
157
158 #[unsafe(method(isPruned))]
164 #[unsafe(method_family = none)]
165 pub unsafe fn isPruned(&self) -> bool;
166
167 #[cfg(feature = "CKSubscription")]
168 #[unsafe(method(subscriptionID))]
170 #[unsafe(method_family = none)]
171 pub unsafe fn subscriptionID(&self) -> Option<Retained<CKSubscriptionID>>;
172 );
173}
174
175impl CKNotification {
177 extern_methods!(
178 #[deprecated = "Interact with UI elements of a CloudKit-server-generated push message via UserNotifications.framework"]
179 #[unsafe(method(alertBody))]
180 #[unsafe(method_family = none)]
181 pub unsafe fn alertBody(&self) -> Option<Retained<NSString>>;
182
183 #[deprecated = "Interact with UI elements of a CloudKit-server-generated push message via UserNotifications.framework"]
184 #[unsafe(method(alertLocalizationKey))]
185 #[unsafe(method_family = none)]
186 pub unsafe fn alertLocalizationKey(&self) -> Option<Retained<NSString>>;
187
188 #[deprecated = "Interact with UI elements of a CloudKit-server-generated push message via UserNotifications.framework"]
189 #[unsafe(method(alertLocalizationArgs))]
190 #[unsafe(method_family = none)]
191 pub unsafe fn alertLocalizationArgs(&self) -> Option<Retained<NSArray<NSString>>>;
192
193 #[unsafe(method(title))]
194 #[unsafe(method_family = none)]
195 pub unsafe fn title(&self) -> Option<Retained<NSString>>;
196
197 #[unsafe(method(titleLocalizationKey))]
198 #[unsafe(method_family = none)]
199 pub unsafe fn titleLocalizationKey(&self) -> Option<Retained<NSString>>;
200
201 #[unsafe(method(titleLocalizationArgs))]
202 #[unsafe(method_family = none)]
203 pub unsafe fn titleLocalizationArgs(&self) -> Option<Retained<NSArray<NSString>>>;
204
205 #[unsafe(method(subtitle))]
206 #[unsafe(method_family = none)]
207 pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
208
209 #[unsafe(method(subtitleLocalizationKey))]
210 #[unsafe(method_family = none)]
211 pub unsafe fn subtitleLocalizationKey(&self) -> Option<Retained<NSString>>;
212
213 #[unsafe(method(subtitleLocalizationArgs))]
214 #[unsafe(method_family = none)]
215 pub unsafe fn subtitleLocalizationArgs(&self) -> Option<Retained<NSArray<NSString>>>;
216
217 #[deprecated = "Interact with UI elements of a CloudKit-server-generated push message via UserNotifications.framework"]
218 #[unsafe(method(alertActionLocalizationKey))]
219 #[unsafe(method_family = none)]
220 pub unsafe fn alertActionLocalizationKey(&self) -> Option<Retained<NSString>>;
221
222 #[deprecated = "Interact with UI elements of a CloudKit-server-generated push message via UserNotifications.framework"]
223 #[unsafe(method(alertLaunchImage))]
224 #[unsafe(method_family = none)]
225 pub unsafe fn alertLaunchImage(&self) -> Option<Retained<NSString>>;
226
227 #[deprecated = "Interact with UI elements of a CloudKit-server-generated push message via UserNotifications.framework"]
228 #[unsafe(method(badge))]
229 #[unsafe(method_family = none)]
230 pub unsafe fn badge(&self) -> Option<Retained<NSNumber>>;
231
232 #[deprecated = "Interact with UI elements of a CloudKit-server-generated push message via UserNotifications.framework"]
233 #[unsafe(method(soundName))]
234 #[unsafe(method_family = none)]
235 pub unsafe fn soundName(&self) -> Option<Retained<NSString>>;
236
237 #[unsafe(method(category))]
238 #[unsafe(method_family = none)]
239 pub unsafe fn category(&self) -> Option<Retained<NSString>>;
240 );
241}
242
243#[repr(transparent)]
246#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
247pub struct CKQueryNotificationReason(pub NSInteger);
248impl CKQueryNotificationReason {
249 #[doc(alias = "CKQueryNotificationReasonRecordCreated")]
250 pub const RecordCreated: Self = Self(1);
251 #[doc(alias = "CKQueryNotificationReasonRecordUpdated")]
252 pub const RecordUpdated: Self = Self(2);
253 #[doc(alias = "CKQueryNotificationReasonRecordDeleted")]
254 pub const RecordDeleted: Self = Self(3);
255}
256
257unsafe impl Encode for CKQueryNotificationReason {
258 const ENCODING: Encoding = NSInteger::ENCODING;
259}
260
261unsafe impl RefEncode for CKQueryNotificationReason {
262 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
263}
264
265extern_class!(
266 #[unsafe(super(CKNotification, NSObject))]
294 #[derive(Debug, PartialEq, Eq, Hash)]
295 pub struct CKQueryNotification;
296);
297
298unsafe impl Send for CKQueryNotification {}
299
300unsafe impl Sync for CKQueryNotification {}
301
302extern_conformance!(
303 unsafe impl NSObjectProtocol for CKQueryNotification {}
304);
305
306impl CKQueryNotification {
307 extern_methods!(
308 #[unsafe(method(queryNotificationReason))]
309 #[unsafe(method_family = none)]
310 pub unsafe fn queryNotificationReason(&self) -> CKQueryNotificationReason;
311
312 #[unsafe(method(recordFields))]
316 #[unsafe(method_family = none)]
317 pub unsafe fn recordFields(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
318
319 #[cfg(feature = "CKRecordID")]
320 #[unsafe(method(recordID))]
321 #[unsafe(method_family = none)]
322 pub unsafe fn recordID(&self) -> Option<Retained<CKRecordID>>;
323
324 #[cfg(feature = "CKDatabase")]
325 #[unsafe(method(databaseScope))]
326 #[unsafe(method_family = none)]
327 pub unsafe fn databaseScope(&self) -> CKDatabaseScope;
328 );
329}
330
331impl CKQueryNotification {
333 extern_methods!(
334 #[unsafe(method(init))]
335 #[unsafe(method_family = init)]
336 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
337
338 #[unsafe(method(new))]
339 #[unsafe(method_family = new)]
340 pub unsafe fn new() -> Retained<Self>;
341
342 #[unsafe(method(notificationFromRemoteNotificationDictionary:))]
343 #[unsafe(method_family = none)]
344 pub unsafe fn notificationFromRemoteNotificationDictionary(
345 notification_dictionary: &NSDictionary,
346 ) -> Option<Retained<Self>>;
347 );
348}
349
350extern_class!(
351 #[unsafe(super(CKNotification, NSObject))]
377 #[derive(Debug, PartialEq, Eq, Hash)]
378 pub struct CKRecordZoneNotification;
379);
380
381unsafe impl Send for CKRecordZoneNotification {}
382
383unsafe impl Sync for CKRecordZoneNotification {}
384
385extern_conformance!(
386 unsafe impl NSObjectProtocol for CKRecordZoneNotification {}
387);
388
389impl CKRecordZoneNotification {
390 extern_methods!(
391 #[cfg(feature = "CKRecordZoneID")]
392 #[unsafe(method(recordZoneID))]
393 #[unsafe(method_family = none)]
394 pub unsafe fn recordZoneID(&self) -> Option<Retained<CKRecordZoneID>>;
395
396 #[cfg(feature = "CKDatabase")]
397 #[unsafe(method(databaseScope))]
398 #[unsafe(method_family = none)]
399 pub unsafe fn databaseScope(&self) -> CKDatabaseScope;
400 );
401}
402
403impl CKRecordZoneNotification {
405 extern_methods!(
406 #[unsafe(method(init))]
407 #[unsafe(method_family = init)]
408 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
409
410 #[unsafe(method(new))]
411 #[unsafe(method_family = new)]
412 pub unsafe fn new() -> Retained<Self>;
413
414 #[unsafe(method(notificationFromRemoteNotificationDictionary:))]
415 #[unsafe(method_family = none)]
416 pub unsafe fn notificationFromRemoteNotificationDictionary(
417 notification_dictionary: &NSDictionary,
418 ) -> Option<Retained<Self>>;
419 );
420}
421
422extern_class!(
423 #[unsafe(super(CKNotification, NSObject))]
448 #[derive(Debug, PartialEq, Eq, Hash)]
449 pub struct CKDatabaseNotification;
450);
451
452unsafe impl Send for CKDatabaseNotification {}
453
454unsafe impl Sync for CKDatabaseNotification {}
455
456extern_conformance!(
457 unsafe impl NSObjectProtocol for CKDatabaseNotification {}
458);
459
460impl CKDatabaseNotification {
461 extern_methods!(
462 #[cfg(feature = "CKDatabase")]
463 #[unsafe(method(databaseScope))]
464 #[unsafe(method_family = none)]
465 pub unsafe fn databaseScope(&self) -> CKDatabaseScope;
466 );
467}
468
469impl CKDatabaseNotification {
471 extern_methods!(
472 #[unsafe(method(init))]
473 #[unsafe(method_family = init)]
474 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
475
476 #[unsafe(method(new))]
477 #[unsafe(method_family = new)]
478 pub unsafe fn new() -> Retained<Self>;
479
480 #[unsafe(method(notificationFromRemoteNotificationDictionary:))]
481 #[unsafe(method_family = none)]
482 pub unsafe fn notificationFromRemoteNotificationDictionary(
483 notification_dictionary: &NSDictionary,
484 ) -> Option<Retained<Self>>;
485 );
486}