objc2_home_kit/generated/HMCharacteristicMetadata.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 /// This class defines the metadata for a characteristic. Metadata provides
11 /// further information about a characteristic’s value, which can be used
12 /// for presentation purposes.
13 ///
14 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadata?language=objc)
15 #[unsafe(super(NSObject))]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 pub struct HMCharacteristicMetadata;
18);
19
20unsafe impl Send for HMCharacteristicMetadata {}
21
22unsafe impl Sync for HMCharacteristicMetadata {}
23
24extern_conformance!(
25 unsafe impl NSObjectProtocol for HMCharacteristicMetadata {}
26);
27
28impl HMCharacteristicMetadata {
29 extern_methods!(
30 #[unsafe(method(init))]
31 #[unsafe(method_family = init)]
32 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
33
34 /// The minimum value for the characteristic if it has a format of "int" or "float".
35 ///
36 /// This property is not atomic.
37 ///
38 /// # Safety
39 ///
40 /// This might not be thread-safe.
41 #[unsafe(method(minimumValue))]
42 #[unsafe(method_family = none)]
43 pub unsafe fn minimumValue(&self) -> Option<Retained<NSNumber>>;
44
45 /// The maximum value for the characteristic if it has a format of "int" or "float".
46 ///
47 /// This property is not atomic.
48 ///
49 /// # Safety
50 ///
51 /// This might not be thread-safe.
52 #[unsafe(method(maximumValue))]
53 #[unsafe(method_family = none)]
54 pub unsafe fn maximumValue(&self) -> Option<Retained<NSNumber>>;
55
56 /// Step value for the characteristic that indicates the minimum step value allowed if it has a format of "int" or "float".
57 ///
58 /// This property is not atomic.
59 ///
60 /// # Safety
61 ///
62 /// This might not be thread-safe.
63 #[unsafe(method(stepValue))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn stepValue(&self) -> Option<Retained<NSNumber>>;
66
67 /// Max length value for the characteristic that indicates the maximum number of UTF-8 characters allowed if it has a format of "string".
68 ///
69 /// This property is not atomic.
70 ///
71 /// # Safety
72 ///
73 /// This might not be thread-safe.
74 #[unsafe(method(maxLength))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn maxLength(&self) -> Option<Retained<NSNumber>>;
77
78 /// The format of the value. Refer to HMCharacteristicMetadataFormat constants for supported units.
79 ///
80 /// This property is not atomic.
81 ///
82 /// # Safety
83 ///
84 /// This might not be thread-safe.
85 #[unsafe(method(format))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn format(&self) -> Option<Retained<NSString>>;
88
89 /// The units of the value. Refer to HMCharacteristicMetadataUnits constants for supported units.
90 ///
91 /// This property is not atomic.
92 ///
93 /// # Safety
94 ///
95 /// This might not be thread-safe.
96 #[unsafe(method(units))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn units(&self) -> Option<Retained<NSString>>;
99
100 /// Manufacturer provided description for the characteristic to present to the user.
101 ///
102 /// This property is not atomic.
103 ///
104 /// # Safety
105 ///
106 /// This might not be thread-safe.
107 #[unsafe(method(manufacturerDescription))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn manufacturerDescription(&self) -> Option<Retained<NSString>>;
110
111 /// The subset of valid values supported by the characteristic when the format is unsigned integral type.
112 ///
113 /// This property is not atomic.
114 ///
115 /// # Safety
116 ///
117 /// This might not be thread-safe.
118 #[unsafe(method(validValues))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn validValues(&self) -> Option<Retained<NSArray<NSNumber>>>;
121 );
122}
123
124/// Methods declared on superclass `NSObject`.
125impl HMCharacteristicMetadata {
126 extern_methods!(
127 #[unsafe(method(new))]
128 #[unsafe(method_family = new)]
129 pub unsafe fn new() -> Retained<Self>;
130 );
131}
132
133extern "C" {
134 /// Describes that the value format is boolean.
135 ///
136 ///
137 /// The value is an NSNumber containing the boolean value.
138 ///
139 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatbool?language=objc)
140 pub static HMCharacteristicMetadataFormatBool: &'static NSString;
141}
142
143extern "C" {
144 /// Describes that the value format is an integer.
145 ///
146 ///
147 /// The value is an NSNumber containing a signed 32-bit integer with a range [-2147483648, 2147483647].
148 ///
149 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatint?language=objc)
150 pub static HMCharacteristicMetadataFormatInt: &'static NSString;
151}
152
153extern "C" {
154 /// Describes that the value format is a float.
155 ///
156 ///
157 /// The value is an NSNumber containing a 32-bit float.
158 ///
159 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatfloat?language=objc)
160 pub static HMCharacteristicMetadataFormatFloat: &'static NSString;
161}
162
163extern "C" {
164 /// Describes that the value format is a string.
165 ///
166 ///
167 /// The value is an NSString.
168 ///
169 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatstring?language=objc)
170 pub static HMCharacteristicMetadataFormatString: &'static NSString;
171}
172
173extern "C" {
174 /// Describes that the value format is an array.
175 ///
176 ///
177 /// The value is an NSArray.
178 ///
179 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatarray?language=objc)
180 pub static HMCharacteristicMetadataFormatArray: &'static NSString;
181}
182
183extern "C" {
184 /// Describes that the value format is a dictionary.
185 ///
186 ///
187 /// The value is an NSDictionary.
188 ///
189 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatdictionary?language=objc)
190 pub static HMCharacteristicMetadataFormatDictionary: &'static NSString;
191}
192
193extern "C" {
194 /// Describes that the value format is an unsigned 8-bit integer.
195 ///
196 ///
197 /// The value is an NSNumber containing an unsigned 8-bit integer with a range [0, 255].
198 ///
199 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatuint8?language=objc)
200 pub static HMCharacteristicMetadataFormatUInt8: &'static NSString;
201}
202
203extern "C" {
204 /// Describes that the value format is an unsigned 16-bit integer.
205 ///
206 ///
207 /// The value is an NSNumber containing an unsigned 16-bit integer with a range [0, 65535].
208 ///
209 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatuint16?language=objc)
210 pub static HMCharacteristicMetadataFormatUInt16: &'static NSString;
211}
212
213extern "C" {
214 /// Describes that the value format is an unsigned 32-bit integer.
215 ///
216 ///
217 /// The value is an NSNumber containing an unsigned 32-bit integer with a range [0, 4294967295].
218 ///
219 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatuint32?language=objc)
220 pub static HMCharacteristicMetadataFormatUInt32: &'static NSString;
221}
222
223extern "C" {
224 /// Describes that the value format is an unsigned 64-bit integer.
225 ///
226 ///
227 /// The value is an NSNumber containing an unsigned 64-bit integer with a range [0, 18446744073709551615].
228 ///
229 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatuint64?language=objc)
230 pub static HMCharacteristicMetadataFormatUInt64: &'static NSString;
231}
232
233extern "C" {
234 /// Describes that the value format is a data blob.
235 ///
236 ///
237 /// The value is an NSData containing the bytes of data.
238 ///
239 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatdata?language=objc)
240 pub static HMCharacteristicMetadataFormatData: &'static NSString;
241}
242
243extern "C" {
244 /// Describes that the value format is a TLV8.
245 ///
246 ///
247 /// The value is an NSData containing a set of one or more TLV8's, which are packed type-length-value items with an 8-bit type, 8-bit length, and N-byte value.
248 ///
249 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformattlv8?language=objc)
250 pub static HMCharacteristicMetadataFormatTLV8: &'static NSString;
251}
252
253extern "C" {
254 /// Describes that the unit of the characteristic is in Celsius.
255 ///
256 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitscelsius?language=objc)
257 pub static HMCharacteristicMetadataUnitsCelsius: &'static NSString;
258}
259
260extern "C" {
261 /// Describes that the unit of the characteristic is in Fahrenheit.
262 ///
263 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitsfahrenheit?language=objc)
264 pub static HMCharacteristicMetadataUnitsFahrenheit: &'static NSString;
265}
266
267extern "C" {
268 /// Describes that the unit of the characteristic is a percentage.
269 ///
270 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitspercentage?language=objc)
271 pub static HMCharacteristicMetadataUnitsPercentage: &'static NSString;
272}
273
274extern "C" {
275 /// Describes that the unit of the characteristic is arc degree.
276 ///
277 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitsarcdegree?language=objc)
278 pub static HMCharacteristicMetadataUnitsArcDegree: &'static NSString;
279}
280
281extern "C" {
282 /// Describes that the unit of the characteristic is seconds.
283 ///
284 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitsseconds?language=objc)
285 pub static HMCharacteristicMetadataUnitsSeconds: &'static NSString;
286}
287
288extern "C" {
289 /// Describes that the unit of the characteristic is Lux (illuminance).
290 ///
291 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitslux?language=objc)
292 pub static HMCharacteristicMetadataUnitsLux: &'static NSString;
293}
294
295extern "C" {
296 /// Describes that the unit of the characteristic is parts per million.
297 ///
298 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitspartspermillion?language=objc)
299 pub static HMCharacteristicMetadataUnitsPartsPerMillion: &'static NSString;
300}
301
302extern "C" {
303 /// Describes that the unit of the characteristic is micrograms per cubic meter.
304 ///
305 /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitsmicrogramspercubicmeter?language=objc)
306 pub static HMCharacteristicMetadataUnitsMicrogramsPerCubicMeter: &'static NSString;
307}