objc2-contacts 0.3.2

Bindings to the Contacts 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::*;

extern_class!(
    /// An immutable value object representing a group.
    ///
    ///
    /// CNGroup is thread safe.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cngroup?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CNGroup;
);

extern_conformance!(
    unsafe impl NSCoding for CNGroup {}
);

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

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

extern_conformance!(
    unsafe impl NSMutableCopying for CNGroup {}
);

#[cfg(feature = "CNMutableGroup")]
unsafe impl MutableCopyingHelper for CNGroup {
    type Result = CNMutableGroup;
}

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

extern_conformance!(
    unsafe impl NSSecureCoding for CNGroup {}
);

impl CNGroup {
    extern_methods!(
        /// The identifier is unique among groups on the device. It can be saved and used for fetching groups next application launch.
        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn identifier(&self) -> Retained<NSString>;

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

/// Methods declared on superclass `NSObject`.
impl CNGroup {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

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

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

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