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