objc2-accounts 0.3.2

Bindings to the Accounts 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!(
    /// [Apple's documentation](https://developer.apple.com/documentation/accounts/acaccount?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
    pub struct ACAccount;
);

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

impl ACAccount {
    extern_methods!(
        #[cfg(feature = "ACAccountType")]
        /// # Safety
        ///
        /// `type` might not allow `None`.
        #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
        #[unsafe(method(initWithAccountType:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithAccountType(
            this: Allocated<Self>,
            r#type: Option<&ACAccountType>,
        ) -> Option<Retained<Self>>;

        #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn identifier(&self) -> Option<Retained<NSString>>;

        #[cfg(feature = "ACAccountType")]
        #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
        #[unsafe(method(accountType))]
        #[unsafe(method_family = none)]
        pub unsafe fn accountType(&self) -> Option<Retained<ACAccountType>>;

        #[cfg(feature = "ACAccountType")]
        /// Setter for [`accountType`][Self::accountType].
        ///
        /// # Safety
        ///
        /// `account_type` might not allow `None`.
        #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
        #[unsafe(method(setAccountType:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAccountType(&self, account_type: Option<&ACAccountType>);

        #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
        #[unsafe(method(accountDescription))]
        #[unsafe(method_family = none)]
        pub unsafe fn accountDescription(&self) -> Retained<NSString>;

        /// Setter for [`accountDescription`][Self::accountDescription].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
        #[unsafe(method(setAccountDescription:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAccountDescription(&self, account_description: Option<&NSString>);

        #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
        #[unsafe(method(username))]
        #[unsafe(method_family = none)]
        pub unsafe fn username(&self) -> Retained<NSString>;

        /// Setter for [`username`][Self::username].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
        #[unsafe(method(setUsername:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setUsername(&self, username: Option<&NSString>);

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

        #[cfg(feature = "ACAccountCredential")]
        #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
        #[unsafe(method(credential))]
        #[unsafe(method_family = none)]
        pub unsafe fn credential(&self) -> Option<Retained<ACAccountCredential>>;

        #[cfg(feature = "ACAccountCredential")]
        /// Setter for [`credential`][Self::credential].
        ///
        /// # Safety
        ///
        /// `credential` might not allow `None`.
        #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
        #[unsafe(method(setCredential:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCredential(&self, credential: Option<&ACAccountCredential>);
    );
}

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