icrate 0.1.2

Bindings to Apple's frameworks
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::CloudKit::*;
use crate::CoreLocation::*;
use crate::Foundation::*;

extern_static!(CKRecordTypeShare: &'static CKRecordType);

extern_static!(CKRecordNameZoneWideShare: &'static NSString);

extern_static!(CKShareTitleKey: &'static CKRecordFieldKey);

extern_static!(CKShareThumbnailImageDataKey: &'static CKRecordFieldKey);

extern_static!(CKShareTypeKey: &'static CKRecordFieldKey);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "CloudKit_CKShare")]
    pub struct CKShare;

    #[cfg(feature = "CloudKit_CKShare")]
    unsafe impl ClassType for CKShare {
        #[inherits(NSObject)]
        type Super = CKRecord;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "CloudKit_CKShare")]
unsafe impl NSCoding for CKShare {}

#[cfg(feature = "CloudKit_CKShare")]
unsafe impl NSCopying for CKShare {}

#[cfg(feature = "CloudKit_CKShare")]
unsafe impl NSObjectProtocol for CKShare {}

#[cfg(feature = "CloudKit_CKShare")]
unsafe impl NSSecureCoding for CKShare {}

extern_methods!(
    #[cfg(feature = "CloudKit_CKShare")]
    unsafe impl CKShare {
        #[method_id(@__retain_semantics Init initWithRootRecord:)]
        pub unsafe fn initWithRootRecord(this: Allocated<Self>, root_record: &CKRecord)
            -> Id<Self>;

        #[cfg(feature = "CloudKit_CKRecordID")]
        #[method_id(@__retain_semantics Init initWithRootRecord:shareID:)]
        pub unsafe fn initWithRootRecord_shareID(
            this: Allocated<Self>,
            root_record: &CKRecord,
            share_id: &CKRecordID,
        ) -> Id<Self>;

        #[cfg(feature = "CloudKit_CKRecordZoneID")]
        #[method_id(@__retain_semantics Init initWithRecordZoneID:)]
        pub unsafe fn initWithRecordZoneID(
            this: Allocated<Self>,
            record_zone_id: &CKRecordZoneID,
        ) -> Id<Self>;

        #[cfg(feature = "Foundation_NSCoder")]
        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, a_decoder: &NSCoder) -> Id<Self>;

        #[method(publicPermission)]
        pub unsafe fn publicPermission(&self) -> CKShareParticipantPermission;

        #[method(setPublicPermission:)]
        pub unsafe fn setPublicPermission(&self, public_permission: CKShareParticipantPermission);

        #[cfg(feature = "Foundation_NSURL")]
        #[method_id(@__retain_semantics Other URL)]
        pub unsafe fn URL(&self) -> Option<Id<NSURL>>;

        #[cfg(all(
            feature = "CloudKit_CKShareParticipant",
            feature = "Foundation_NSArray"
        ))]
        #[method_id(@__retain_semantics Other participants)]
        pub unsafe fn participants(&self) -> Id<NSArray<CKShareParticipant>>;

        #[cfg(feature = "CloudKit_CKShareParticipant")]
        #[method_id(@__retain_semantics Other owner)]
        pub unsafe fn owner(&self) -> Id<CKShareParticipant>;

        #[cfg(feature = "CloudKit_CKShareParticipant")]
        #[method_id(@__retain_semantics Other currentUserParticipant)]
        pub unsafe fn currentUserParticipant(&self) -> Option<Id<CKShareParticipant>>;

        #[cfg(feature = "CloudKit_CKShareParticipant")]
        #[method(addParticipant:)]
        pub unsafe fn addParticipant(&self, participant: &CKShareParticipant);

        #[cfg(feature = "CloudKit_CKShareParticipant")]
        #[method(removeParticipant:)]
        pub unsafe fn removeParticipant(&self, participant: &CKShareParticipant);

        #[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>;
    }
);