objc2-foundation 0.3.1

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

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

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

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

#[cfg(feature = "NSObject")]
unsafe impl CopyingHelper for NSPersonNameComponents {
    type Result = Self;
}

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

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

impl NSPersonNameComponents {
    extern_methods!(
        #[cfg(feature = "NSString")]
        #[unsafe(method(namePrefix))]
        #[unsafe(method_family = none)]
        pub unsafe fn namePrefix(&self) -> Option<Retained<NSString>>;

        #[cfg(feature = "NSString")]
        /// Setter for [`namePrefix`][Self::namePrefix].
        #[unsafe(method(setNamePrefix:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setNamePrefix(&self, name_prefix: Option<&NSString>);

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

        #[cfg(feature = "NSString")]
        /// Setter for [`givenName`][Self::givenName].
        #[unsafe(method(setGivenName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setGivenName(&self, given_name: Option<&NSString>);

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

        #[cfg(feature = "NSString")]
        /// Setter for [`middleName`][Self::middleName].
        #[unsafe(method(setMiddleName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMiddleName(&self, middle_name: Option<&NSString>);

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

        #[cfg(feature = "NSString")]
        /// Setter for [`familyName`][Self::familyName].
        #[unsafe(method(setFamilyName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setFamilyName(&self, family_name: Option<&NSString>);

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

        #[cfg(feature = "NSString")]
        /// Setter for [`nameSuffix`][Self::nameSuffix].
        #[unsafe(method(setNameSuffix:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setNameSuffix(&self, name_suffix: Option<&NSString>);

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

        #[cfg(feature = "NSString")]
        /// Setter for [`nickname`][Self::nickname].
        #[unsafe(method(setNickname:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setNickname(&self, nickname: Option<&NSString>);

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

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

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