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 ///
38 /// This property is not atomic.
39 ///
40 /// # Safety
41 ///
42 /// This might not be thread-safe.
43 #[unsafe(method(biometryType))]
44 #[unsafe(method_family = none)]
45 pub unsafe fn biometryType(&self) -> LABiometryType;
46
47 /// Whether the user has enrolled this biometry.
48 ///
49 /// Even if biometry is enrolled, it does not necessarily mean that it can be used. You should check
50 /// `isUsable`property to see if it is available for use.
51 ///
52 /// This property is not atomic.
53 ///
54 /// # Safety
55 ///
56 /// This might not be thread-safe.
57 #[unsafe(method(isEnrolled))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn isEnrolled(&self) -> bool;
60
61 /// Whether biometry is locked out.
62 ///
63 /// The system might lock the user out of biometry for various reasons. For example, with Face ID, the user is
64 /// locked out after 5 failed match attempts in row. To recover from bio lockout, users need to enter their passcode
65 /// (e.g. during device ulock).
66 ///
67 /// This property is not atomic.
68 ///
69 /// # Safety
70 ///
71 /// This might not be thread-safe.
72 #[unsafe(method(isLockedOut))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn isLockedOut(&self) -> bool;
75
76 /// The application specific state of the biometric enrollment as returned by
77 /// `LAContext.domainState.biometry.stateHash`
78 /// This value represents the state of the enrollment and changes whenever the biometric enrollment is changed.
79 /// It does not directly map to the enrolled templates, e.g. if a finger is added to Touch ID enrollement and then
80 /// removed, the final state would be different.
81 /// It also returns different values to different apps to prevent tracking of user identity.
82 ///
83 /// This property is not atomic.
84 ///
85 /// # Safety
86 ///
87 /// This might not be thread-safe.
88 #[unsafe(method(stateHash))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn stateHash(&self) -> Retained<NSData>;
91
92 /// Whether the built in biometric sensor is inaccessible in the current configuration, preventing the use of biometry.
93 ///
94 /// Currently, the only example of this is a Clamshell Mode on macOS. The user will be not able to use Touch ID
95 /// if the MacBook lid is closed while connected to external monitor and keyboard, unless the external keyboard
96 /// has Touch ID.
97 ///
98 /// This property is not atomic.
99 ///
100 /// # Safety
101 ///
102 /// This might not be thread-safe.
103 #[unsafe(method(builtInSensorInaccessible))]
104 #[unsafe(method_family = none)]
105 pub unsafe fn builtInSensorInaccessible(&self) -> bool;
106 );
107}
108
109/// Methods declared on superclass `LAEnvironmentMechanism`.
110#[cfg(feature = "LAEnvironmentMechanism")]
111impl LAEnvironmentMechanismBiometry {
112 extern_methods!(
113 /// Clients should only consume environment mechanisms..
114 #[unsafe(method(new))]
115 #[unsafe(method_family = new)]
116 pub unsafe fn new() -> Retained<Self>;
117
118 /// The Clients should only consume environment mechanisms..
119 #[unsafe(method(init))]
120 #[unsafe(method_family = init)]
121 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
122 );
123}