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 postal address.
    ///
    ///
    /// CNPostalAddress is thread safe.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cnpostaladdress?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CNPostalAddress;
);

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

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

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

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

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

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

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

impl CNPostalAddress {
    extern_methods!(
        /// multi-street address is delimited with carriage returns ā€œ
        /// \nā€
        #[unsafe(method(street))]
        #[unsafe(method_family = none)]
        pub unsafe fn street(&self) -> Retained<NSString>;

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

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

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

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

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

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

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

        /// Returns a user displayable property name.
        #[unsafe(method(localizedStringForKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn localizedStringForKey(key: &NSString) -> Retained<NSString>;
    );
}

/// Methods declared on superclass `NSObject`.
impl CNPostalAddress {
    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/cnpostaladdressstreetkey?language=objc)
    pub static CNPostalAddressStreetKey: &'static NSString;
}

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

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

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

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

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

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

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