objc2-collaboration 0.3.2

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

use crate::*;

extern_class!(
    /// An identity authority is a database that stores information about
    /// identities. The `CBIdentityAuthority` class defines one or more identity
    /// authorities. This database can be searched for identities in conjunction
    /// with the `CBIdentity` class factory methods.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/collaboration/cbidentityauthority?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CBIdentityAuthority;
);

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

impl CBIdentityAuthority {
    extern_methods!(
        /// Returns the identity authority on the local system.
        ///
        /// Any identities stored on the local system are contained within this identity
        /// authority.
        ///
        /// - Returns: The identity authority on the local system.
        #[unsafe(method(localIdentityAuthority))]
        #[unsafe(method_family = none)]
        pub unsafe fn localIdentityAuthority() -> Retained<CBIdentityAuthority>;

        /// Returns the identity authority that contains all the identities in bound
        /// network directory servers.
        ///
        /// If you are bound to a network directory server (such as an LDAP server) that
        /// has an identity authority, use this method to search those authorities.
        ///
        /// - Returns: The identity authorities in bound network directory servers.
        #[unsafe(method(managedIdentityAuthority))]
        #[unsafe(method_family = none)]
        pub unsafe fn managedIdentityAuthority() -> Retained<CBIdentityAuthority>;

        /// Returns an identity authority that contains the identities in both the local
        /// and the network-bound authorities.
        ///
        /// The default identity authority is the logical union of the identities in the
        /// local and managed authorities.
        ///
        /// - Returns: The local and network-bound identity authorities.
        #[unsafe(method(defaultIdentityAuthority))]
        #[unsafe(method_family = none)]
        pub unsafe fn defaultIdentityAuthority() -> Retained<CBIdentityAuthority>;

        #[cfg(feature = "objc2-core-services")]
        /// Returns an identity authority specified by a given Core Services Identity
        /// authority object.
        ///
        /// This method, along with ``CBIdentityAuthority/CSIdentityAuthority``, is used
        /// for interoperability with the Core Services Identity API.
        ///
        /// - Parameters:
        /// - CSIdentityAuthority: The Core Services Identity opaque object.
        ///
        /// - Returns: The identity authority object for use with the Collaboration
        /// framework.
        #[unsafe(method(identityAuthorityWithCSIdentityAuthority:))]
        #[unsafe(method_family = none)]
        pub unsafe fn identityAuthorityWithCSIdentityAuthority(
            cs_identity_authority: &CSIdentityAuthority,
        ) -> Retained<CBIdentityAuthority>;

        #[cfg(feature = "objc2-core-services")]
        /// Returns an identity authority for use with the Core Services Identity API.
        ///
        /// This method, along with
        /// ``CBIdentityAuthority/identityAuthorityWithCSIdentityAuthority:``, is used
        /// for interoperability with the Core Services Identity API.
        ///
        /// - Returns: The opaque authority object for use with the Core Services
        /// Identity API.
        #[unsafe(method(CSIdentityAuthority))]
        #[unsafe(method_family = none)]
        pub unsafe fn CSIdentityAuthority(&self) -> Retained<CSIdentityAuthority>;

        /// Returns the localized name of the identity authority.
        ///
        /// - Returns: The computer’s name if the authority is local, or Managed Network
        /// Directory if the authority is managed.
        #[unsafe(method(localizedName))]
        #[unsafe(method_family = none)]
        pub unsafe fn localizedName(&self) -> Retained<NSString>;
    );
}

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