objc2_contacts/generated/
CNContainer.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/contacts/cncontainertype?language=objc)
10// NS_ENUM
11#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct CNContainerType(pub NSInteger);
14impl CNContainerType {
15    #[doc(alias = "CNContainerTypeUnassigned")]
16    pub const Unassigned: Self = Self(0);
17    #[doc(alias = "CNContainerTypeLocal")]
18    pub const Local: Self = Self(1);
19    #[doc(alias = "CNContainerTypeExchange")]
20    pub const Exchange: Self = Self(2);
21    #[doc(alias = "CNContainerTypeCardDAV")]
22    pub const CardDAV: Self = Self(3);
23}
24
25unsafe impl Encode for CNContainerType {
26    const ENCODING: Encoding = NSInteger::ENCODING;
27}
28
29unsafe impl RefEncode for CNContainerType {
30    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
31}
32
33extern_class!(
34    /// An immutable value object representing a container.
35    ///
36    ///
37    /// CNContainer is thread safe.
38    ///
39    /// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cncontainer?language=objc)
40    #[unsafe(super(NSObject))]
41    #[derive(Debug, PartialEq, Eq, Hash)]
42    pub struct CNContainer;
43);
44
45extern_conformance!(
46    unsafe impl NSCoding for CNContainer {}
47);
48
49extern_conformance!(
50    unsafe impl NSCopying for CNContainer {}
51);
52
53unsafe impl CopyingHelper for CNContainer {
54    type Result = Self;
55}
56
57extern_conformance!(
58    unsafe impl NSObjectProtocol for CNContainer {}
59);
60
61extern_conformance!(
62    unsafe impl NSSecureCoding for CNContainer {}
63);
64
65impl CNContainer {
66    extern_methods!(
67        /// The identifier is unique among containers on the device. It can be saved and used for fetching containers next application launch.
68        #[unsafe(method(identifier))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn identifier(&self) -> Retained<NSString>;
71
72        #[unsafe(method(name))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn name(&self) -> Retained<NSString>;
75
76        #[unsafe(method(type))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn r#type(&self) -> CNContainerType;
79    );
80}
81
82/// Methods declared on superclass `NSObject`.
83impl CNContainer {
84    extern_methods!(
85        #[unsafe(method(init))]
86        #[unsafe(method_family = init)]
87        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
88
89        #[unsafe(method(new))]
90        #[unsafe(method_family = new)]
91        pub unsafe fn new() -> Retained<Self>;
92    );
93}
94
95extern "C" {
96    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cncontaineridentifierkey?language=objc)
97    pub static CNContainerIdentifierKey: &'static NSString;
98}
99
100extern "C" {
101    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cncontainernamekey?language=objc)
102    pub static CNContainerNameKey: &'static NSString;
103}
104
105extern "C" {
106    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cncontainertypekey?language=objc)
107    pub static CNContainerTypeKey: &'static NSString;
108}