use crate::common::*;
use crate::CloudKit::*;
use crate::CoreLocation::*;
use crate::Foundation::*;
pub type CKRecordType = NSString;
pub type CKRecordFieldKey = NSString;
extern_static!(CKRecordTypeUserRecord: &'static CKRecordType);
extern_static!(CKRecordRecordIDKey: &'static CKRecordFieldKey);
extern_static!(CKRecordCreatorUserRecordIDKey: &'static CKRecordFieldKey);
extern_static!(CKRecordCreationDateKey: &'static CKRecordFieldKey);
extern_static!(CKRecordLastModifiedUserRecordIDKey: &'static CKRecordFieldKey);
extern_static!(CKRecordModificationDateKey: &'static CKRecordFieldKey);
extern_static!(CKRecordParentKey: &'static CKRecordFieldKey);
extern_static!(CKRecordShareKey: &'static CKRecordFieldKey);
extern_protocol!(
pub unsafe trait CKRecordValue: NSObjectProtocol {}
unsafe impl ProtocolType for dyn CKRecordValue {}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "CloudKit_CKRecord")]
pub struct CKRecord;
#[cfg(feature = "CloudKit_CKRecord")]
unsafe impl ClassType for CKRecord {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
#[cfg(feature = "CloudKit_CKRecord")]
unsafe impl NSCoding for CKRecord {}
#[cfg(feature = "CloudKit_CKRecord")]
unsafe impl NSCopying for CKRecord {}
#[cfg(feature = "CloudKit_CKRecord")]
unsafe impl NSObjectProtocol for CKRecord {}
#[cfg(feature = "CloudKit_CKRecord")]
unsafe impl NSSecureCoding for CKRecord {}
extern_methods!(
#[cfg(feature = "CloudKit_CKRecord")]
unsafe impl CKRecord {
#[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 initWithRecordType:)]
pub unsafe fn initWithRecordType(
this: Allocated<Self>,
record_type: &CKRecordType,
) -> Id<Self>;
#[cfg(feature = "CloudKit_CKRecordID")]
#[method_id(@__retain_semantics Init initWithRecordType:recordID:)]
pub unsafe fn initWithRecordType_recordID(
this: Allocated<Self>,
record_type: &CKRecordType,
record_id: &CKRecordID,
) -> Id<Self>;
#[cfg(feature = "CloudKit_CKRecordZoneID")]
#[method_id(@__retain_semantics Init initWithRecordType:zoneID:)]
pub unsafe fn initWithRecordType_zoneID(
this: Allocated<Self>,
record_type: &CKRecordType,
zone_id: &CKRecordZoneID,
) -> Id<Self>;
#[method_id(@__retain_semantics Other recordType)]
pub unsafe fn recordType(&self) -> Id<CKRecordType>;
#[cfg(feature = "CloudKit_CKRecordID")]
#[method_id(@__retain_semantics Other recordID)]
pub unsafe fn recordID(&self) -> Id<CKRecordID>;
#[cfg(feature = "Foundation_NSString")]
#[method_id(@__retain_semantics Other recordChangeTag)]
pub unsafe fn recordChangeTag(&self) -> Option<Id<NSString>>;
#[cfg(feature = "CloudKit_CKRecordID")]
#[method_id(@__retain_semantics Other creatorUserRecordID)]
pub unsafe fn creatorUserRecordID(&self) -> Option<Id<CKRecordID>>;
#[cfg(feature = "Foundation_NSDate")]
#[method_id(@__retain_semantics Other creationDate)]
pub unsafe fn creationDate(&self) -> Option<Id<NSDate>>;
#[cfg(feature = "CloudKit_CKRecordID")]
#[method_id(@__retain_semantics Other lastModifiedUserRecordID)]
pub unsafe fn lastModifiedUserRecordID(&self) -> Option<Id<CKRecordID>>;
#[cfg(feature = "Foundation_NSDate")]
#[method_id(@__retain_semantics Other modificationDate)]
pub unsafe fn modificationDate(&self) -> Option<Id<NSDate>>;
#[method_id(@__retain_semantics Other objectForKey:)]
pub unsafe fn objectForKey(
&self,
key: &CKRecordFieldKey,
) -> Option<Id<ProtocolObject<dyn CKRecordValue>>>;
#[method(setObject:forKey:)]
pub unsafe fn setObject_forKey(
&self,
object: Option<&ProtocolObject<dyn CKRecordValue>>,
key: &CKRecordFieldKey,
);
#[cfg(feature = "Foundation_NSArray")]
#[method_id(@__retain_semantics Other allKeys)]
pub unsafe fn allKeys(&self) -> Id<NSArray<CKRecordFieldKey>>;
#[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSString"))]
#[method_id(@__retain_semantics Other allTokens)]
pub unsafe fn allTokens(&self) -> Id<NSArray<NSString>>;
#[method_id(@__retain_semantics Other objectForKeyedSubscript:)]
pub unsafe fn objectForKeyedSubscript(
&self,
key: &CKRecordFieldKey,
) -> Option<Id<ProtocolObject<dyn CKRecordValue>>>;
#[method(setObject:forKeyedSubscript:)]
pub unsafe fn setObject_forKeyedSubscript(
&self,
object: Option<&ProtocolObject<dyn CKRecordValue>>,
key: &CKRecordFieldKey,
);
#[cfg(feature = "Foundation_NSArray")]
#[method_id(@__retain_semantics Other changedKeys)]
pub unsafe fn changedKeys(&self) -> Id<NSArray<CKRecordFieldKey>>;
#[cfg(feature = "Foundation_NSCoder")]
#[method(encodeSystemFieldsWithCoder:)]
pub unsafe fn encodeSystemFieldsWithCoder(&self, coder: &NSCoder);
#[cfg(feature = "CloudKit_CKReference")]
#[method_id(@__retain_semantics Other share)]
pub unsafe fn share(&self) -> Option<Id<CKReference>>;
#[cfg(feature = "CloudKit_CKReference")]
#[method_id(@__retain_semantics Other parent)]
pub unsafe fn parent(&self) -> Option<Id<CKReference>>;
#[cfg(feature = "CloudKit_CKReference")]
#[method(setParent:)]
pub unsafe fn setParent(&self, parent: Option<&CKReference>);
#[method(setParentReferenceFromRecord:)]
pub unsafe fn setParentReferenceFromRecord(&self, parent_record: Option<&CKRecord>);
#[cfg(feature = "CloudKit_CKRecordID")]
#[method(setParentReferenceFromRecordID:)]
pub unsafe fn setParentReferenceFromRecordID(&self, parent_record_id: Option<&CKRecordID>);
}
);
extern_methods!(
#[cfg(feature = "Foundation_NSString")]
unsafe impl NSString {}
);
#[cfg(feature = "Foundation_NSString")]
unsafe impl CKRecordValue for NSString {}
extern_methods!(
#[cfg(feature = "Foundation_NSNumber")]
unsafe impl NSNumber {}
);
#[cfg(feature = "Foundation_NSNumber")]
unsafe impl CKRecordValue for NSNumber {}
extern_methods!(
#[cfg(feature = "Foundation_NSArray")]
unsafe impl NSArray {}
);
#[cfg(feature = "Foundation_NSArray")]
unsafe impl CKRecordValue for NSArray {}
extern_methods!(
#[cfg(feature = "Foundation_NSDate")]
unsafe impl NSDate {}
);
#[cfg(feature = "Foundation_NSDate")]
unsafe impl CKRecordValue for NSDate {}
extern_methods!(
#[cfg(feature = "Foundation_NSData")]
unsafe impl NSData {}
);
#[cfg(feature = "Foundation_NSData")]
unsafe impl CKRecordValue for NSData {}
extern_methods!(
#[cfg(feature = "CloudKit_CKReference")]
unsafe impl CKReference {}
);
#[cfg(feature = "CloudKit_CKReference")]
unsafe impl CKRecordValue for CKReference {}
extern_methods!(
#[cfg(feature = "CloudKit_CKAsset")]
unsafe impl CKAsset {}
);
#[cfg(feature = "CloudKit_CKAsset")]
unsafe impl CKRecordValue for CKAsset {}
extern_methods!(
#[cfg(feature = "CoreLocation_CLLocation")]
unsafe impl CLLocation {}
);
#[cfg(feature = "CoreLocation_CLLocation")]
unsafe impl CKRecordValue for CLLocation {}
extern_protocol!(
pub unsafe trait CKRecordKeyValueSetting: NSObjectProtocol {
#[method_id(@__retain_semantics Other objectForKey:)]
unsafe fn objectForKey(
&self,
key: &CKRecordFieldKey,
) -> Option<Id<ProtocolObject<dyn CKRecordValue>>>;
#[method(setObject:forKey:)]
unsafe fn setObject_forKey(
&self,
object: Option<&ProtocolObject<dyn CKRecordValue>>,
key: &CKRecordFieldKey,
);
#[method_id(@__retain_semantics Other objectForKeyedSubscript:)]
unsafe fn objectForKeyedSubscript(
&self,
key: &CKRecordFieldKey,
) -> Option<Id<ProtocolObject<dyn CKRecordValue>>>;
#[method(setObject:forKeyedSubscript:)]
unsafe fn setObject_forKeyedSubscript(
&self,
object: Option<&ProtocolObject<dyn CKRecordValue>>,
key: &CKRecordFieldKey,
);
#[cfg(feature = "Foundation_NSArray")]
#[method_id(@__retain_semantics Other allKeys)]
unsafe fn allKeys(&self) -> Id<NSArray<CKRecordFieldKey>>;
#[cfg(feature = "Foundation_NSArray")]
#[method_id(@__retain_semantics Other changedKeys)]
unsafe fn changedKeys(&self) -> Id<NSArray<CKRecordFieldKey>>;
}
unsafe impl ProtocolType for dyn CKRecordKeyValueSetting {}
);
extern_methods!(
#[cfg(feature = "CloudKit_CKRecord")]
unsafe impl CKRecord {
#[method_id(@__retain_semantics Other encryptedValues)]
pub unsafe fn encryptedValues(&self) -> Id<ProtocolObject<dyn CKRecordKeyValueSetting>>;
}
);
#[cfg(feature = "CloudKit_CKRecord")]
unsafe impl CKRecordKeyValueSetting for CKRecord {}