objc2-core-data 0.3.2

Bindings to the CoreData framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/coredata/nspersistentcloudkitcontainereventtype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSPersistentCloudKitContainerEventType(pub NSInteger);
impl NSPersistentCloudKitContainerEventType {
    #[doc(alias = "NSPersistentCloudKitContainerEventTypeSetup")]
    pub const Setup: Self = Self(0);
    #[doc(alias = "NSPersistentCloudKitContainerEventTypeImport")]
    pub const Import: Self = Self(1);
    #[doc(alias = "NSPersistentCloudKitContainerEventTypeExport")]
    pub const Export: Self = Self(2);
}

unsafe impl Encode for NSPersistentCloudKitContainerEventType {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSPersistentCloudKitContainerEventType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nspersistentcloudkitcontainereventchangednotification?language=objc)
    pub static NSPersistentCloudKitContainerEventChangedNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nspersistentcloudkitcontainereventuserinfokey?language=objc)
    pub static NSPersistentCloudKitContainerEventUserInfoKey: &'static NSString;
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nspersistentcloudkitcontainerevent?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSPersistentCloudKitContainerEvent;
);

extern_conformance!(
    unsafe impl NSCopying for NSPersistentCloudKitContainerEvent {}
);

unsafe impl CopyingHelper for NSPersistentCloudKitContainerEvent {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for NSPersistentCloudKitContainerEvent {}
);

impl NSPersistentCloudKitContainerEvent {
    extern_methods!(
        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn identifier(&self) -> Retained<NSUUID>;

        #[unsafe(method(storeIdentifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn storeIdentifier(&self) -> Retained<NSString>;

        #[unsafe(method(type))]
        #[unsafe(method_family = none)]
        pub unsafe fn r#type(&self) -> NSPersistentCloudKitContainerEventType;

        #[unsafe(method(startDate))]
        #[unsafe(method_family = none)]
        pub unsafe fn startDate(&self) -> Retained<NSDate>;

        #[unsafe(method(endDate))]
        #[unsafe(method_family = none)]
        pub unsafe fn endDate(&self) -> Option<Retained<NSDate>>;

        #[unsafe(method(succeeded))]
        #[unsafe(method_family = none)]
        pub unsafe fn succeeded(&self) -> bool;

        #[unsafe(method(error))]
        #[unsafe(method_family = none)]
        pub unsafe fn error(&self) -> Option<Retained<NSError>>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}