objc2-home-kit 0.3.2

Bindings to the HomeKit framework
Documentation
//! 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::*;

extern_class!(
    /// This class defines the metadata for a characteristic. Metadata provides
    /// further information about a characteristic’s value, which can be used
    /// for presentation purposes.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadata?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct HMCharacteristicMetadata;
);

unsafe impl Send for HMCharacteristicMetadata {}

unsafe impl Sync for HMCharacteristicMetadata {}

extern_conformance!(
    unsafe impl NSObjectProtocol for HMCharacteristicMetadata {}
);

impl HMCharacteristicMetadata {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        /// The minimum value for the characteristic if it has a format of "int" or "float".
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(minimumValue))]
        #[unsafe(method_family = none)]
        pub unsafe fn minimumValue(&self) -> Option<Retained<NSNumber>>;

        /// The maximum value for the characteristic if it has a format of "int" or "float".
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(maximumValue))]
        #[unsafe(method_family = none)]
        pub unsafe fn maximumValue(&self) -> Option<Retained<NSNumber>>;

        /// Step value for the characteristic that indicates the minimum step value allowed if it has a format of "int" or "float".
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(stepValue))]
        #[unsafe(method_family = none)]
        pub unsafe fn stepValue(&self) -> Option<Retained<NSNumber>>;

        /// Max length value for the characteristic that indicates the maximum number of UTF-8 characters allowed if it has a format of "string".
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(maxLength))]
        #[unsafe(method_family = none)]
        pub unsafe fn maxLength(&self) -> Option<Retained<NSNumber>>;

        /// The format of the value. Refer to HMCharacteristicMetadataFormat constants for supported units.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(format))]
        #[unsafe(method_family = none)]
        pub unsafe fn format(&self) -> Option<Retained<NSString>>;

        /// The units of the value. Refer to HMCharacteristicMetadataUnits constants for supported units.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(units))]
        #[unsafe(method_family = none)]
        pub unsafe fn units(&self) -> Option<Retained<NSString>>;

        /// Manufacturer provided description for the characteristic to present to the user.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(manufacturerDescription))]
        #[unsafe(method_family = none)]
        pub unsafe fn manufacturerDescription(&self) -> Option<Retained<NSString>>;

        /// The subset of valid values supported by the characteristic when the format is unsigned integral type.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(validValues))]
        #[unsafe(method_family = none)]
        pub unsafe fn validValues(&self) -> Option<Retained<NSArray<NSNumber>>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl HMCharacteristicMetadata {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern "C" {
    /// Describes that the value format is boolean.
    ///
    ///
    /// The value is an NSNumber containing the boolean value.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatbool?language=objc)
    pub static HMCharacteristicMetadataFormatBool: &'static NSString;
}

extern "C" {
    /// Describes that the value format is an integer.
    ///
    ///
    /// The value is an NSNumber containing a signed 32-bit integer with a range [-2147483648, 2147483647].
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatint?language=objc)
    pub static HMCharacteristicMetadataFormatInt: &'static NSString;
}

extern "C" {
    /// Describes that the value format is a float.
    ///
    ///
    /// The value is an NSNumber containing a 32-bit float.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatfloat?language=objc)
    pub static HMCharacteristicMetadataFormatFloat: &'static NSString;
}

extern "C" {
    /// Describes that the value format is a string.
    ///
    ///
    /// The value is an NSString.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatstring?language=objc)
    pub static HMCharacteristicMetadataFormatString: &'static NSString;
}

extern "C" {
    /// Describes that the value format is an array.
    ///
    ///
    /// The value is an NSArray.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatarray?language=objc)
    pub static HMCharacteristicMetadataFormatArray: &'static NSString;
}

extern "C" {
    /// Describes that the value format is a dictionary.
    ///
    ///
    /// The value is an NSDictionary.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatdictionary?language=objc)
    pub static HMCharacteristicMetadataFormatDictionary: &'static NSString;
}

extern "C" {
    /// Describes that the value format is an unsigned 8-bit integer.
    ///
    ///
    /// The value is an NSNumber containing an unsigned 8-bit integer with a range [0, 255].
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatuint8?language=objc)
    pub static HMCharacteristicMetadataFormatUInt8: &'static NSString;
}

extern "C" {
    /// Describes that the value format is an unsigned 16-bit integer.
    ///
    ///
    /// The value is an NSNumber containing an unsigned 16-bit integer with a range [0, 65535].
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatuint16?language=objc)
    pub static HMCharacteristicMetadataFormatUInt16: &'static NSString;
}

extern "C" {
    /// Describes that the value format is an unsigned 32-bit integer.
    ///
    ///
    /// The value is an NSNumber containing an unsigned 32-bit integer with a range [0, 4294967295].
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatuint32?language=objc)
    pub static HMCharacteristicMetadataFormatUInt32: &'static NSString;
}

extern "C" {
    /// Describes that the value format is an unsigned 64-bit integer.
    ///
    ///
    /// The value is an NSNumber containing an unsigned 64-bit integer with a range [0, 18446744073709551615].
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatuint64?language=objc)
    pub static HMCharacteristicMetadataFormatUInt64: &'static NSString;
}

extern "C" {
    /// Describes that the value format is a data blob.
    ///
    ///
    /// The value is an NSData containing the bytes of data.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformatdata?language=objc)
    pub static HMCharacteristicMetadataFormatData: &'static NSString;
}

extern "C" {
    /// Describes that the value format is a TLV8.
    ///
    ///
    /// 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.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataformattlv8?language=objc)
    pub static HMCharacteristicMetadataFormatTLV8: &'static NSString;
}

extern "C" {
    /// Describes that the unit of the characteristic is in Celsius.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitscelsius?language=objc)
    pub static HMCharacteristicMetadataUnitsCelsius: &'static NSString;
}

extern "C" {
    /// Describes that the unit of the characteristic is in Fahrenheit.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitsfahrenheit?language=objc)
    pub static HMCharacteristicMetadataUnitsFahrenheit: &'static NSString;
}

extern "C" {
    /// Describes that the unit of the characteristic is a percentage.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitspercentage?language=objc)
    pub static HMCharacteristicMetadataUnitsPercentage: &'static NSString;
}

extern "C" {
    /// Describes that the unit of the characteristic is arc degree.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitsarcdegree?language=objc)
    pub static HMCharacteristicMetadataUnitsArcDegree: &'static NSString;
}

extern "C" {
    /// Describes that the unit of the characteristic is seconds.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitsseconds?language=objc)
    pub static HMCharacteristicMetadataUnitsSeconds: &'static NSString;
}

extern "C" {
    /// Describes that the unit of the characteristic is Lux (illuminance).
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitslux?language=objc)
    pub static HMCharacteristicMetadataUnitsLux: &'static NSString;
}

extern "C" {
    /// Describes that the unit of the characteristic is parts per million.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitspartspermillion?language=objc)
    pub static HMCharacteristicMetadataUnitsPartsPerMillion: &'static NSString;
}

extern "C" {
    /// Describes that the unit of the characteristic is micrograms per cubic meter.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicmetadataunitsmicrogramspercubicmeter?language=objc)
    pub static HMCharacteristicMetadataUnitsMicrogramsPerCubicMeter: &'static NSString;
}