objc2-local-authentication 0.3.2

Bindings to the LocalAuthentication 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!(
    /// [Apple's documentation](https://developer.apple.com/documentation/localauthentication/ladomainstatebiometry?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct LADomainStateBiometry;
);

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

impl LADomainStateBiometry {
    extern_methods!(
        #[cfg(feature = "LABiometryType")]
        /// Indicates biometry type available on the device.
        #[unsafe(method(biometryType))]
        #[unsafe(method_family = none)]
        pub unsafe fn biometryType(&self) -> LABiometryType;

        /// Contains state hash data for the available biometry type. Returns `nil` if no biometry entities are enrolled.
        ///
        ///
        /// If biometric database was modified (fingers, faces were removed or added), `stateHash`
        /// data will change. Nature of such database changes cannot be determined
        /// but comparing data of `stateHash` after different evaluatePolicy calls
        /// will reveal the fact database was changed between the calls.
        ///
        ///
        /// Warning: Please note that the value returned by this property can change exceptionally between major OS versions even if
        /// the state of biometry has not changed.
        #[unsafe(method(stateHash))]
        #[unsafe(method_family = none)]
        pub unsafe fn stateHash(&self) -> Option<Retained<NSData>>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

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

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

impl LADomainStateCompanion {
    extern_methods!(
        /// Indicates types of companions paired with the device.
        /// The elements are NSNumber-wrapped instances of
        /// ``LACompanionType`.`
        #[unsafe(method(availableCompanionTypes))]
        #[unsafe(method_family = none)]
        pub unsafe fn availableCompanionTypes(&self) -> Retained<NSSet<NSNumber>>;

        /// Contains combined state hash data for all available companion types. . Returns `nil` if no companion devices are paired.
        ///
        ///
        /// As long as database of paired companion devices doesn't change,
        /// `stateHash` stays the same for the same set of `availableCompanions`.
        ///
        /// If database of paired companion devices was modified, `stateHash`
        /// data will change. Nature of such database changes cannot be determined
        /// but comparing data of `stateHash` after different policy evaluation
        /// will reveal the fact database was changed between calls.
        ///
        /// If you are interested in a state hash for a specific companion type
        /// you can use `stateHashForCompanionType` method.
        ///
        ///
        /// Warning: Please note that the value returned by this property can change exceptionally between major OS versions even if
        /// the list of paired companions has not changed.
        #[unsafe(method(stateHash))]
        #[unsafe(method_family = none)]
        pub unsafe fn stateHash(&self) -> Option<Retained<NSData>>;

        #[cfg(feature = "LACompanionType")]
        /// Returns state hash data for the given companion type.
        ///
        ///
        /// If database of paired devices of the given type was modified state hash
        /// data will change. Nature of such database changes cannot be determined
        /// but comparing data of state hash after different policy evaluation
        /// will reveal the fact database was changed between calls.
        ///
        ///
        /// Parameter `companionType`: The companion type for which state hash data should be returned.
        #[unsafe(method(stateHashForCompanionType:))]
        #[unsafe(method_family = none)]
        pub unsafe fn stateHashForCompanionType(
            &self,
            companion_type: LACompanionType,
        ) -> Option<Retained<NSData>>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

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

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

impl LADomainState {
    extern_methods!(
        /// Contains biometric domain state.
        #[unsafe(method(biometry))]
        #[unsafe(method_family = none)]
        pub unsafe fn biometry(&self) -> Retained<LADomainStateBiometry>;

        /// Contains companion domain state.
        #[unsafe(method(companion))]
        #[unsafe(method_family = none)]
        pub unsafe fn companion(&self) -> Retained<LADomainStateCompanion>;

        /// Contains combined state hash data for biometry and companion state hashes.
        ///
        ///
        /// Warning: Please note that the value returned by this property can change exceptionally between major OS versions even if
        /// the list of paired companions has not changed.
        #[unsafe(method(stateHash))]
        #[unsafe(method_family = none)]
        pub unsafe fn stateHash(&self) -> Option<Retained<NSData>>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}