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::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// A mutable value object representing a postal address.
    ///
    ///
    /// CNMutablePostalAddress is not thread safe.
    ///
    ///
    /// Note: To remove properties when saving a mutable postal address, set string properties to empty values.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cnmutablepostaladdress?language=objc)
    #[unsafe(super(CNPostalAddress, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "CNPostalAddress")]
    pub struct CNMutablePostalAddress;
);

#[cfg(feature = "CNPostalAddress")]
extern_conformance!(
    unsafe impl NSCoding for CNMutablePostalAddress {}
);

#[cfg(feature = "CNPostalAddress")]
extern_conformance!(
    unsafe impl NSCopying for CNMutablePostalAddress {}
);

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

#[cfg(feature = "CNPostalAddress")]
extern_conformance!(
    unsafe impl NSMutableCopying for CNMutablePostalAddress {}
);

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

#[cfg(feature = "CNPostalAddress")]
extern_conformance!(
    unsafe impl NSObjectProtocol for CNMutablePostalAddress {}
);

#[cfg(feature = "CNPostalAddress")]
extern_conformance!(
    unsafe impl NSSecureCoding for CNMutablePostalAddress {}
);

#[cfg(feature = "CNPostalAddress")]
impl CNMutablePostalAddress {
    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>;

        /// Setter for [`street`][Self::street].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setStreet:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStreet(&self, street: &NSString);

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

        /// Setter for [`subLocality`][Self::subLocality].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSubLocality:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSubLocality(&self, sub_locality: &NSString);

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

        /// Setter for [`city`][Self::city].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setCity:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCity(&self, city: &NSString);

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

        /// Setter for [`subAdministrativeArea`][Self::subAdministrativeArea].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSubAdministrativeArea:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSubAdministrativeArea(&self, sub_administrative_area: &NSString);

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

        /// Setter for [`state`][Self::state].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setState:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setState(&self, state: &NSString);

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

        /// Setter for [`postalCode`][Self::postalCode].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setPostalCode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPostalCode(&self, postal_code: &NSString);

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

        /// Setter for [`country`][Self::country].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setCountry:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCountry(&self, country: &NSString);

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

        /// Setter for [`ISOCountryCode`][Self::ISOCountryCode].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setISOCountryCode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setISOCountryCode(&self, iso_country_code: &NSString);
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "CNPostalAddress")]
impl CNMutablePostalAddress {
    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>;
    );
}