use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CKSubscriptionType(pub NSInteger);
impl CKSubscriptionType {
#[doc(alias = "CKSubscriptionTypeQuery")]
pub const Query: Self = Self(1);
#[doc(alias = "CKSubscriptionTypeRecordZone")]
pub const RecordZone: Self = Self(2);
#[doc(alias = "CKSubscriptionTypeDatabase")]
pub const Database: Self = Self(3);
}
unsafe impl Encode for CKSubscriptionType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for CKSubscriptionType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type CKSubscriptionID = NSString;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CKSubscription;
unsafe impl ClassType for CKSubscription {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for CKSubscription {}
unsafe impl NSCopying for CKSubscription {}
unsafe impl NSObjectProtocol for CKSubscription {}
unsafe impl NSSecureCoding for CKSubscription {}
extern_methods!(
unsafe impl CKSubscription {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
#[method_id(@__retain_semantics Other subscriptionID)]
pub unsafe fn subscriptionID(&self) -> Retained<CKSubscriptionID>;
#[method(subscriptionType)]
pub unsafe fn subscriptionType(&self) -> CKSubscriptionType;
#[method_id(@__retain_semantics Other notificationInfo)]
pub unsafe fn notificationInfo(&self) -> Option<Retained<CKNotificationInfo>>;
#[method(setNotificationInfo:)]
pub unsafe fn setNotificationInfo(&self, notification_info: Option<&CKNotificationInfo>);
}
);
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CKQuerySubscriptionOptions(pub NSUInteger);
bitflags::bitflags! {
impl CKQuerySubscriptionOptions: NSUInteger {
#[doc(alias = "CKQuerySubscriptionOptionsFiresOnRecordCreation")]
const FiresOnRecordCreation = 1<<0;
#[doc(alias = "CKQuerySubscriptionOptionsFiresOnRecordUpdate")]
const FiresOnRecordUpdate = 1<<1;
#[doc(alias = "CKQuerySubscriptionOptionsFiresOnRecordDeletion")]
const FiresOnRecordDeletion = 1<<2;
#[doc(alias = "CKQuerySubscriptionOptionsFiresOnce")]
const FiresOnce = 1<<3;
}
}
unsafe impl Encode for CKQuerySubscriptionOptions {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for CKQuerySubscriptionOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CKQuerySubscription;
unsafe impl ClassType for CKQuerySubscription {
#[inherits(NSObject)]
type Super = CKSubscription;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for CKQuerySubscription {}
unsafe impl NSCopying for CKQuerySubscription {}
unsafe impl NSObjectProtocol for CKQuerySubscription {}
unsafe impl NSSecureCoding for CKQuerySubscription {}
extern_methods!(
unsafe impl CKQuerySubscription {
#[cfg(feature = "CKRecord")]
#[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,
) -> Retained<Self>;
#[cfg(feature = "CKRecord")]
#[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,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(this: Allocated<Self>, a_decoder: &NSCoder) -> Retained<Self>;
#[cfg(feature = "CKRecord")]
#[method_id(@__retain_semantics Other recordType)]
pub unsafe fn recordType(&self) -> Retained<CKRecordType>;
#[method_id(@__retain_semantics Other predicate)]
pub unsafe fn predicate(&self) -> Retained<NSPredicate>;
#[cfg(feature = "CKRecordZoneID")]
#[method_id(@__retain_semantics Other zoneID)]
pub unsafe fn zoneID(&self) -> Option<Retained<CKRecordZoneID>>;
#[cfg(feature = "CKRecordZoneID")]
#[method(setZoneID:)]
pub unsafe fn setZoneID(&self, zone_id: Option<&CKRecordZoneID>);
#[method(querySubscriptionOptions)]
pub unsafe fn querySubscriptionOptions(&self) -> CKQuerySubscriptionOptions;
}
);
extern_methods!(
unsafe impl CKQuerySubscription {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CKRecordZoneSubscription;
unsafe impl ClassType for CKRecordZoneSubscription {
#[inherits(NSObject)]
type Super = CKSubscription;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for CKRecordZoneSubscription {}
unsafe impl NSCopying for CKRecordZoneSubscription {}
unsafe impl NSObjectProtocol for CKRecordZoneSubscription {}
unsafe impl NSSecureCoding for CKRecordZoneSubscription {}
extern_methods!(
unsafe impl CKRecordZoneSubscription {
#[cfg(feature = "CKRecordZoneID")]
#[deprecated]
#[method_id(@__retain_semantics Init initWithZoneID:)]
pub unsafe fn initWithZoneID(
this: Allocated<Self>,
zone_id: &CKRecordZoneID,
) -> Retained<Self>;
#[cfg(feature = "CKRecordZoneID")]
#[method_id(@__retain_semantics Init initWithZoneID:subscriptionID:)]
pub unsafe fn initWithZoneID_subscriptionID(
this: Allocated<Self>,
zone_id: &CKRecordZoneID,
subscription_id: &CKSubscriptionID,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(this: Allocated<Self>, a_decoder: &NSCoder) -> Retained<Self>;
#[cfg(feature = "CKRecordZoneID")]
#[method_id(@__retain_semantics Other zoneID)]
pub unsafe fn zoneID(&self) -> Retained<CKRecordZoneID>;
#[cfg(feature = "CKRecord")]
#[method_id(@__retain_semantics Other recordType)]
pub unsafe fn recordType(&self) -> Option<Retained<CKRecordType>>;
#[cfg(feature = "CKRecord")]
#[method(setRecordType:)]
pub unsafe fn setRecordType(&self, record_type: Option<&CKRecordType>);
}
);
extern_methods!(
unsafe impl CKRecordZoneSubscription {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CKDatabaseSubscription;
unsafe impl ClassType for CKDatabaseSubscription {
#[inherits(NSObject)]
type Super = CKSubscription;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for CKDatabaseSubscription {}
unsafe impl NSCopying for CKDatabaseSubscription {}
unsafe impl NSObjectProtocol for CKDatabaseSubscription {}
unsafe impl NSSecureCoding for CKDatabaseSubscription {}
extern_methods!(
unsafe impl CKDatabaseSubscription {
#[deprecated]
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithSubscriptionID:)]
pub unsafe fn initWithSubscriptionID(
this: Allocated<Self>,
subscription_id: &CKSubscriptionID,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(this: Allocated<Self>, a_decoder: &NSCoder) -> Retained<Self>;
#[cfg(feature = "CKRecord")]
#[method_id(@__retain_semantics Other recordType)]
pub unsafe fn recordType(&self) -> Option<Retained<CKRecordType>>;
#[cfg(feature = "CKRecord")]
#[method(setRecordType:)]
pub unsafe fn setRecordType(&self, record_type: Option<&CKRecordType>);
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CKNotificationInfo;
unsafe impl ClassType for CKNotificationInfo {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for CKNotificationInfo {}
unsafe impl NSCopying for CKNotificationInfo {}
unsafe impl NSObjectProtocol for CKNotificationInfo {}
unsafe impl NSSecureCoding for CKNotificationInfo {}
extern_methods!(
unsafe impl CKNotificationInfo {
#[method_id(@__retain_semantics Other alertBody)]
pub unsafe fn alertBody(&self) -> Option<Retained<NSString>>;
#[method(setAlertBody:)]
pub unsafe fn setAlertBody(&self, alert_body: Option<&NSString>);
#[method_id(@__retain_semantics Other alertLocalizationKey)]
pub unsafe fn alertLocalizationKey(&self) -> Option<Retained<NSString>>;
#[method(setAlertLocalizationKey:)]
pub unsafe fn setAlertLocalizationKey(&self, alert_localization_key: Option<&NSString>);
#[cfg(feature = "CKRecord")]
#[method_id(@__retain_semantics Other alertLocalizationArgs)]
pub unsafe fn alertLocalizationArgs(&self) -> Option<Retained<NSArray<CKRecordFieldKey>>>;
#[cfg(feature = "CKRecord")]
#[method(setAlertLocalizationArgs:)]
pub unsafe fn setAlertLocalizationArgs(
&self,
alert_localization_args: Option<&NSArray<CKRecordFieldKey>>,
);
#[method_id(@__retain_semantics Other title)]
pub unsafe fn title(&self) -> Option<Retained<NSString>>;
#[method(setTitle:)]
pub unsafe fn setTitle(&self, title: Option<&NSString>);
#[method_id(@__retain_semantics Other titleLocalizationKey)]
pub unsafe fn titleLocalizationKey(&self) -> Option<Retained<NSString>>;
#[method(setTitleLocalizationKey:)]
pub unsafe fn setTitleLocalizationKey(&self, title_localization_key: Option<&NSString>);
#[cfg(feature = "CKRecord")]
#[method_id(@__retain_semantics Other titleLocalizationArgs)]
pub unsafe fn titleLocalizationArgs(&self) -> Option<Retained<NSArray<CKRecordFieldKey>>>;
#[cfg(feature = "CKRecord")]
#[method(setTitleLocalizationArgs:)]
pub unsafe fn setTitleLocalizationArgs(
&self,
title_localization_args: Option<&NSArray<CKRecordFieldKey>>,
);
#[method_id(@__retain_semantics Other subtitle)]
pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
#[method(setSubtitle:)]
pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>);
#[method_id(@__retain_semantics Other subtitleLocalizationKey)]
pub unsafe fn subtitleLocalizationKey(&self) -> Option<Retained<NSString>>;
#[method(setSubtitleLocalizationKey:)]
pub unsafe fn setSubtitleLocalizationKey(
&self,
subtitle_localization_key: Option<&NSString>,
);
#[cfg(feature = "CKRecord")]
#[method_id(@__retain_semantics Other subtitleLocalizationArgs)]
pub unsafe fn subtitleLocalizationArgs(
&self,
) -> Option<Retained<NSArray<CKRecordFieldKey>>>;
#[cfg(feature = "CKRecord")]
#[method(setSubtitleLocalizationArgs:)]
pub unsafe fn setSubtitleLocalizationArgs(
&self,
subtitle_localization_args: Option<&NSArray<CKRecordFieldKey>>,
);
#[method_id(@__retain_semantics Other alertActionLocalizationKey)]
pub unsafe fn alertActionLocalizationKey(&self) -> Option<Retained<NSString>>;
#[method(setAlertActionLocalizationKey:)]
pub unsafe fn setAlertActionLocalizationKey(
&self,
alert_action_localization_key: Option<&NSString>,
);
#[method_id(@__retain_semantics Other alertLaunchImage)]
pub unsafe fn alertLaunchImage(&self) -> Option<Retained<NSString>>;
#[method(setAlertLaunchImage:)]
pub unsafe fn setAlertLaunchImage(&self, alert_launch_image: Option<&NSString>);
#[method_id(@__retain_semantics Other soundName)]
pub unsafe fn soundName(&self) -> Option<Retained<NSString>>;
#[method(setSoundName:)]
pub unsafe fn setSoundName(&self, sound_name: Option<&NSString>);
#[cfg(feature = "CKRecord")]
#[method_id(@__retain_semantics Other desiredKeys)]
pub unsafe fn desiredKeys(&self) -> Option<Retained<NSArray<CKRecordFieldKey>>>;
#[cfg(feature = "CKRecord")]
#[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);
#[method_id(@__retain_semantics Other category)]
pub unsafe fn category(&self) -> Option<Retained<NSString>>;
#[method(setCategory:)]
pub unsafe fn setCategory(&self, category: Option<&NSString>);
#[method_id(@__retain_semantics Other collapseIDKey)]
pub unsafe fn collapseIDKey(&self) -> Option<Retained<NSString>>;
#[method(setCollapseIDKey:)]
pub unsafe fn setCollapseIDKey(&self, collapse_id_key: Option<&NSString>);
}
);
extern_methods!(
unsafe impl CKNotificationInfo {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);