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