1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
//! 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::*;
/// Represents the conduction type used for an HKAudiogramSensitivityTest
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkaudiogramconductiontype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct HKAudiogramConductionType(pub NSInteger);
impl HKAudiogramConductionType {
#[doc(alias = "HKAudiogramConductionTypeAir")]
pub const Air: Self = Self(0);
}
unsafe impl Encode for HKAudiogramConductionType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for HKAudiogramConductionType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
/// Represents the test side used for an HKAudiogramSensitivityTest
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkaudiogramsensitivitytestside?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct HKAudiogramSensitivityTestSide(pub NSInteger);
impl HKAudiogramSensitivityTestSide {
#[doc(alias = "HKAudiogramSensitivityTestSideLeft")]
pub const Left: Self = Self(0);
#[doc(alias = "HKAudiogramSensitivityTestSideRight")]
pub const Right: Self = Self(1);
}
unsafe impl Encode for HKAudiogramSensitivityTestSide {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for HKAudiogramSensitivityTestSide {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkaudiogramsensitivitytest?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct HKAudiogramSensitivityTest;
);
unsafe impl Send for HKAudiogramSensitivityTest {}
unsafe impl Sync for HKAudiogramSensitivityTest {}
extern_conformance!(
unsafe impl NSCoding for HKAudiogramSensitivityTest {}
);
extern_conformance!(
unsafe impl NSCopying for HKAudiogramSensitivityTest {}
);
unsafe impl CopyingHelper for HKAudiogramSensitivityTest {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for HKAudiogramSensitivityTest {}
);
extern_conformance!(
unsafe impl NSSecureCoding for HKAudiogramSensitivityTest {}
);
impl HKAudiogramSensitivityTest {
extern_methods!(
#[cfg(feature = "HKQuantity")]
/// Ear sensitivity measured in dB from a baseline of 0 dB. Reduced hearing sensitivity corresponds to an increase from 0 dB.
/// The unit of measurement is `HKUnit.decibelHearingLevelUnit` or "dBHL".
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(sensitivity))]
#[unsafe(method_family = none)]
pub unsafe fn sensitivity(&self) -> Retained<HKQuantity>;
/// The conduction type
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(type))]
#[unsafe(method_family = none)]
pub unsafe fn r#type(&self) -> HKAudiogramConductionType;
/// Indicates if the test was conducted with or without masking
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(masked))]
#[unsafe(method_family = none)]
pub unsafe fn masked(&self) -> bool;
/// The test side
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(side))]
#[unsafe(method_family = none)]
pub unsafe fn side(&self) -> HKAudiogramSensitivityTestSide;
#[cfg(feature = "HKAudiogramSensitivityPointClampingRange")]
/// If present, indicates that the range within which the sensitivity point should be clamped.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(clampingRange))]
#[unsafe(method_family = none)]
pub unsafe fn clampingRange(
&self,
) -> Option<Retained<HKAudiogramSensitivityPointClampingRange>>;
#[cfg(all(
feature = "HKAudiogramSensitivityPointClampingRange",
feature = "HKQuantity"
))]
/// Creates a sensitivity test which can be added to a HKAudiogramSensitivityPoint
///
/// Parameter `sensitivity`: The ear sensitivity measured in dB from a baseline of 0 dB with unit `HKUnit.decibelHearingLevelUnit` or "dBHL".
///
/// Parameter `type`: The type of test
///
/// Parameter `masked`: If the test was conducted with or without masking
///
/// Parameter `side`: The test side which was tested
///
/// Parameter `clampingRange`: The clamping range (if any)
///
/// Parameter `errorOut`: If there was a problem creating this instance this will contain the error.
///
/// Returns: New instance of a Sensitivity Test or nil if there were problems
/// creating the instance. Errors may include incorrect quantity units or sensitivity out of range
#[unsafe(method(initWithSensitivity:type:masked:side:clampingRange:error:_))]
#[unsafe(method_family = init)]
pub unsafe fn initWithSensitivity_type_masked_side_clampingRange_error(
this: Allocated<Self>,
sensitivity: &HKQuantity,
r#type: HKAudiogramConductionType,
masked: bool,
side: HKAudiogramSensitivityTestSide,
clamping_range: Option<&HKAudiogramSensitivityPointClampingRange>,
) -> Result<Retained<Self>, Retained<NSError>>;
#[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>;
);
}