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 objc2::__framework_prelude::*;

use crate::*;

/// This enumeration describes the different types of presence events.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmpresenceeventtype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct HMPresenceEventType(pub NSUInteger);
impl HMPresenceEventType {
    /// This corresponds to trigger an event for every user entering a home.
    /// This cannot be added as predicate.
    #[doc(alias = "HMPresenceEventTypeEveryEntry")]
    pub const EveryEntry: Self = Self(1);
    /// This corresponds to trigger an event for every user exiting a home.
    /// This cannot be added as predicate.
    #[doc(alias = "HMPresenceEventTypeEveryExit")]
    pub const EveryExit: Self = Self(2);
    /// This corresponds to trigger an event for the first user entering a home.
    #[doc(alias = "HMPresenceEventTypeFirstEntry")]
    pub const FirstEntry: Self = Self(3);
    /// This corresponds to trigger an event for the last user exiting a home.
    #[doc(alias = "HMPresenceEventTypeLastExit")]
    pub const LastExit: Self = Self(4);
    /// Convenience value for First Entry to use in predicate of HMEventTrigger.
    #[doc(alias = "HMPresenceEventTypeAtHome")]
    pub const AtHome: Self = Self(HMPresenceEventType::FirstEntry.0);
    /// Convenience value for Last Exit to use in predicate of HMEventTrigger.
    #[doc(alias = "HMPresenceEventTypeNotAtHome")]
    pub const NotAtHome: Self = Self(HMPresenceEventType::LastExit.0);
}

unsafe impl Encode for HMPresenceEventType {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for HMPresenceEventType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// This enumeration describes the different types of user sets in presence events.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmpresenceeventusertype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct HMPresenceEventUserType(pub NSUInteger);
impl HMPresenceEventUserType {
    /// Only current user's presence is used.
    #[doc(alias = "HMPresenceEventUserTypeCurrentUser")]
    pub const CurrentUser: Self = Self(1);
    /// Presence of all home users is used.
    #[doc(alias = "HMPresenceEventUserTypeHomeUsers")]
    pub const HomeUsers: Self = Self(2);
    /// Presence of custom set of home users is used.
    #[doc(alias = "HMPresenceEventUserTypeCustomUsers")]
    pub const CustomUsers: Self = Self(3);
}

unsafe impl Encode for HMPresenceEventUserType {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for HMPresenceEventUserType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}