objc2-pass-kit 0.3.2

Bindings to the PassKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-contacts")]
use objc2_contacts::*;
use objc2_foundation::*;

use crate::*;

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

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

impl PKContact {
    extern_methods!(
        #[unsafe(method(name))]
        #[unsafe(method_family = none)]
        pub unsafe fn name(&self) -> Option<Retained<NSPersonNameComponents>>;

        /// Setter for [`name`][Self::name].
        #[unsafe(method(setName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setName(&self, name: Option<&NSPersonNameComponents>);

        #[cfg(feature = "objc2-contacts")]
        #[unsafe(method(postalAddress))]
        #[unsafe(method_family = none)]
        pub unsafe fn postalAddress(&self) -> Option<Retained<CNPostalAddress>>;

        #[cfg(feature = "objc2-contacts")]
        /// Setter for [`postalAddress`][Self::postalAddress].
        #[unsafe(method(setPostalAddress:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPostalAddress(&self, postal_address: Option<&CNPostalAddress>);

        #[cfg(feature = "objc2-contacts")]
        #[unsafe(method(phoneNumber))]
        #[unsafe(method_family = none)]
        pub unsafe fn phoneNumber(&self) -> Option<Retained<CNPhoneNumber>>;

        #[cfg(feature = "objc2-contacts")]
        /// Setter for [`phoneNumber`][Self::phoneNumber].
        #[unsafe(method(setPhoneNumber:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPhoneNumber(&self, phone_number: Option<&CNPhoneNumber>);

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

        /// Setter for [`emailAddress`][Self::emailAddress].
        #[unsafe(method(setEmailAddress:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setEmailAddress(&self, email_address: Option<&NSString>);

        #[deprecated = "Use subLocality and subAdministrativeArea on -postalAddress instead"]
        #[unsafe(method(supplementarySubLocality))]
        #[unsafe(method_family = none)]
        pub unsafe fn supplementarySubLocality(&self) -> Option<Retained<NSString>>;

        /// Setter for [`supplementarySubLocality`][Self::supplementarySubLocality].
        #[deprecated = "Use subLocality and subAdministrativeArea on -postalAddress instead"]
        #[unsafe(method(setSupplementarySubLocality:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSupplementarySubLocality(
            &self,
            supplementary_sub_locality: Option<&NSString>,
        );
    );
}

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