objc2_local_authentication/generated/LADomainState.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/ladomainstatebiometry?language=objc)
11 #[unsafe(super(NSObject))]
12 #[derive(Debug, PartialEq, Eq, Hash)]
13 pub struct LADomainStateBiometry;
14);
15
16extern_conformance!(
17 unsafe impl NSObjectProtocol for LADomainStateBiometry {}
18);
19
20impl LADomainStateBiometry {
21 extern_methods!(
22 #[cfg(feature = "LABiometryType")]
23 /// Indicates biometry type available on the device.
24 #[unsafe(method(biometryType))]
25 #[unsafe(method_family = none)]
26 pub unsafe fn biometryType(&self) -> LABiometryType;
27
28 /// Contains state hash data for the available biometry type. Returns `nil` if no biometry entities are enrolled.
29 ///
30 ///
31 /// If biometric database was modified (fingers, faces were removed or added), `stateHash`
32 /// data will change. Nature of such database changes cannot be determined
33 /// but comparing data of `stateHash` after different evaluatePolicy calls
34 /// will reveal the fact database was changed between the calls.
35 ///
36 ///
37 /// Warning: Please note that the value returned by this property can change exceptionally between major OS versions even if
38 /// the state of biometry has not changed.
39 #[unsafe(method(stateHash))]
40 #[unsafe(method_family = none)]
41 pub unsafe fn stateHash(&self) -> Option<Retained<NSData>>;
42
43 #[unsafe(method(new))]
44 #[unsafe(method_family = new)]
45 pub unsafe fn new() -> Retained<Self>;
46
47 #[unsafe(method(init))]
48 #[unsafe(method_family = init)]
49 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
50 );
51}
52
53extern_class!(
54 /// [Apple's documentation](https://developer.apple.com/documentation/localauthentication/ladomainstatecompanion?language=objc)
55 #[unsafe(super(NSObject))]
56 #[derive(Debug, PartialEq, Eq, Hash)]
57 pub struct LADomainStateCompanion;
58);
59
60extern_conformance!(
61 unsafe impl NSObjectProtocol for LADomainStateCompanion {}
62);
63
64impl LADomainStateCompanion {
65 extern_methods!(
66 /// Indicates types of companions paired with the device.
67 /// The elements are NSNumber-wrapped instances of
68 /// ``LACompanionType`.`
69 #[unsafe(method(availableCompanionTypes))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn availableCompanionTypes(&self) -> Retained<NSSet<NSNumber>>;
72
73 /// Contains combined state hash data for all available companion types. . Returns `nil` if no companion devices are paired.
74 ///
75 ///
76 /// As long as database of paired companion devices doesn't change,
77 /// `stateHash` stays the same for the same set of `availableCompanions`.
78 ///
79 /// If database of paired companion devices was modified, `stateHash`
80 /// data will change. Nature of such database changes cannot be determined
81 /// but comparing data of `stateHash` after different policy evaluation
82 /// will reveal the fact database was changed between calls.
83 ///
84 /// If you are interested in a state hash for a specific companion type
85 /// you can use `stateHashForCompanionType` method.
86 ///
87 ///
88 /// Warning: Please note that the value returned by this property can change exceptionally between major OS versions even if
89 /// the list of paired companions has not changed.
90 #[unsafe(method(stateHash))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn stateHash(&self) -> Option<Retained<NSData>>;
93
94 #[cfg(feature = "LACompanionType")]
95 /// Returns state hash data for the given companion type.
96 ///
97 ///
98 /// If database of paired devices of the given type was modified state hash
99 /// data will change. Nature of such database changes cannot be determined
100 /// but comparing data of state hash after different policy evaluation
101 /// will reveal the fact database was changed between calls.
102 ///
103 ///
104 /// Parameter `companionType`: The companion type for which state hash data should be returned.
105 #[unsafe(method(stateHashForCompanionType:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn stateHashForCompanionType(
108 &self,
109 companion_type: LACompanionType,
110 ) -> Option<Retained<NSData>>;
111
112 #[unsafe(method(new))]
113 #[unsafe(method_family = new)]
114 pub unsafe fn new() -> Retained<Self>;
115
116 #[unsafe(method(init))]
117 #[unsafe(method_family = init)]
118 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
119 );
120}
121
122extern_class!(
123 /// [Apple's documentation](https://developer.apple.com/documentation/localauthentication/ladomainstate?language=objc)
124 #[unsafe(super(NSObject))]
125 #[derive(Debug, PartialEq, Eq, Hash)]
126 pub struct LADomainState;
127);
128
129extern_conformance!(
130 unsafe impl NSObjectProtocol for LADomainState {}
131);
132
133impl LADomainState {
134 extern_methods!(
135 /// Contains biometric domain state.
136 #[unsafe(method(biometry))]
137 #[unsafe(method_family = none)]
138 pub unsafe fn biometry(&self) -> Retained<LADomainStateBiometry>;
139
140 /// Contains companion domain state.
141 #[unsafe(method(companion))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn companion(&self) -> Retained<LADomainStateCompanion>;
144
145 /// Contains combined state hash data for biometry and companion state hashes.
146 ///
147 ///
148 /// Warning: Please note that the value returned by this property can change exceptionally between major OS versions even if
149 /// the list of paired companions has not changed.
150 #[unsafe(method(stateHash))]
151 #[unsafe(method_family = none)]
152 pub unsafe fn stateHash(&self) -> Option<Retained<NSData>>;
153
154 #[unsafe(method(new))]
155 #[unsafe(method_family = new)]
156 pub unsafe fn new() -> Retained<Self>;
157
158 #[unsafe(method(init))]
159 #[unsafe(method_family = init)]
160 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
161 );
162}