objc2_local_authentication/generated/LAEnvironmentMechanismBiometry.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 /// [Apple's documentation](https://developer.apple.com/documentation/localauthentication/laenvironmentmechanismbiometry?language=objc)
11 #[unsafe(super(LAEnvironmentMechanism, NSObject))]
12 #[derive(Debug, PartialEq, Eq, Hash)]
13 #[cfg(feature = "LAEnvironmentMechanism")]
14 pub struct LAEnvironmentMechanismBiometry;
15);
16
17#[cfg(feature = "LAEnvironmentMechanism")]
18unsafe impl Send for LAEnvironmentMechanismBiometry {}
19
20#[cfg(feature = "LAEnvironmentMechanism")]
21unsafe impl Sync for LAEnvironmentMechanismBiometry {}
22
23#[cfg(feature = "LAEnvironmentMechanism")]
24extern_conformance!(
25 unsafe impl NSObjectProtocol for LAEnvironmentMechanismBiometry {}
26);
27
28#[cfg(feature = "LAEnvironmentMechanism")]
29impl LAEnvironmentMechanismBiometry {
30 extern_methods!(
31 #[cfg(feature = "LABiometryType")]
32 /// Type of biometry supported by the device.
33 ///
34 /// This property does not indicate whether biometry is available or not. It always reads the type of biometry
35 /// supported by device hardware. You should check
36 /// `isUsable`property to see if it is available for use.
37 #[unsafe(method(biometryType))]
38 #[unsafe(method_family = none)]
39 pub unsafe fn biometryType(&self) -> LABiometryType;
40
41 /// Whether the user has enrolled this biometry.
42 ///
43 /// Even if biometry is enrolled, it does not necessarily mean that it can be used. You should check
44 /// `isUsable`property to see if it is available for use.
45 #[unsafe(method(isEnrolled))]
46 #[unsafe(method_family = none)]
47 pub unsafe fn isEnrolled(&self) -> bool;
48
49 /// Whether biometry is locked out.
50 ///
51 /// The system might lock the user out of biometry for various reasons. For example, with Face ID, the user is
52 /// locked out after 5 failed match attempts in row. To recover from bio lockout, users need to enter their passcode
53 /// (e.g. during device ulock).
54 #[unsafe(method(isLockedOut))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn isLockedOut(&self) -> bool;
57
58 /// The application specific state of the biometric enrollment as returned by
59 /// `LAContext.domainState.biometry.stateHash`
60 /// This value represents the state of the enrollment and changes whenever the biometric enrollment is changed.
61 /// It does not directly map to the enrolled templates, e.g. if a finger is added to Touch ID enrollement and then
62 /// removed, the final state would be different.
63 /// It also returns different values to different apps to prevent tracking of user identity.
64 #[unsafe(method(stateHash))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn stateHash(&self) -> Retained<NSData>;
67
68 /// Whether the built in biometric sensor is inaccessible in the current configuration, preventing the use of biometry.
69 ///
70 /// Currently, the only example of this is a Clamshell Mode on macOS. The user will be not able to use Touch ID
71 /// if the MacBook lid is closed while connected to external monitor and keyboard, unless the external keyboard
72 /// has Touch ID.
73 #[unsafe(method(builtInSensorInaccessible))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn builtInSensorInaccessible(&self) -> bool;
76 );
77}
78
79/// Methods declared on superclass `LAEnvironmentMechanism`.
80#[cfg(feature = "LAEnvironmentMechanism")]
81impl LAEnvironmentMechanismBiometry {
82 extern_methods!(
83 /// Clients should only consume environment mechanisms..
84 #[unsafe(method(new))]
85 #[unsafe(method_family = new)]
86 pub unsafe fn new() -> Retained<Self>;
87
88 /// The Clients should only consume environment mechanisms..
89 #[unsafe(method(init))]
90 #[unsafe(method_family = init)]
91 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
92 );
93}