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!(
    /// Contains related information for a specific contact property.
    ///
    ///
    /// CNContactProperty is used by the CNContactPicker to return the user's selected property.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cncontactproperty?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CNContactProperty;
);

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

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

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

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

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

impl CNContactProperty {
    extern_methods!(
        #[cfg(feature = "CNContact")]
        #[unsafe(method(contact))]
        #[unsafe(method_family = none)]
        pub unsafe fn contact(&self) -> Retained<CNContact>;

        /// The key of the contact property, as defined in CNContact.h.
        #[unsafe(method(key))]
        #[unsafe(method_family = none)]
        pub unsafe fn key(&self) -> Retained<NSString>;

        /// The value of the property.
        #[unsafe(method(value))]
        #[unsafe(method_family = none)]
        pub unsafe fn value(&self) -> Option<Retained<AnyObject>>;

        /// The identifier of the labeled value if the property is an array of labeled values, otherwise is nil.
        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn identifier(&self) -> Option<Retained<NSString>>;

        /// The label of the labeled value if the property is an array of labeled values, otherwise is nil.
        #[unsafe(method(label))]
        #[unsafe(method_family = none)]
        pub unsafe fn label(&self) -> Option<Retained<NSString>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl CNContactProperty {
    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>;
    );
}