objc2_home_kit/generated/
HMPresenceEventDefines.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use objc2::__framework_prelude::*;
4
5use crate::*;
6
7/// This enumeration describes the different types of presence events.
8///
9/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmpresenceeventtype?language=objc)
10// NS_ENUM
11#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct HMPresenceEventType(pub NSUInteger);
14impl HMPresenceEventType {
15    /// This corresponds to trigger an event for every user entering a home.
16    /// This cannot be added as predicate.
17    #[doc(alias = "HMPresenceEventTypeEveryEntry")]
18    pub const EveryEntry: Self = Self(1);
19    /// This corresponds to trigger an event for every user exiting a home.
20    /// This cannot be added as predicate.
21    #[doc(alias = "HMPresenceEventTypeEveryExit")]
22    pub const EveryExit: Self = Self(2);
23    /// This corresponds to trigger an event for the first user entering a home.
24    #[doc(alias = "HMPresenceEventTypeFirstEntry")]
25    pub const FirstEntry: Self = Self(3);
26    /// This corresponds to trigger an event for the last user exiting a home.
27    #[doc(alias = "HMPresenceEventTypeLastExit")]
28    pub const LastExit: Self = Self(4);
29    /// Convenience value for First Entry to use in predicate of HMEventTrigger.
30    #[doc(alias = "HMPresenceEventTypeAtHome")]
31    pub const AtHome: Self = Self(HMPresenceEventType::FirstEntry.0);
32    /// Convenience value for Last Exit to use in predicate of HMEventTrigger.
33    #[doc(alias = "HMPresenceEventTypeNotAtHome")]
34    pub const NotAtHome: Self = Self(HMPresenceEventType::LastExit.0);
35}
36
37unsafe impl Encode for HMPresenceEventType {
38    const ENCODING: Encoding = NSUInteger::ENCODING;
39}
40
41unsafe impl RefEncode for HMPresenceEventType {
42    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
43}
44
45/// This enumeration describes the different types of user sets in presence events.
46///
47/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmpresenceeventusertype?language=objc)
48// NS_ENUM
49#[repr(transparent)]
50#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
51pub struct HMPresenceEventUserType(pub NSUInteger);
52impl HMPresenceEventUserType {
53    /// Only current user's presence is used.
54    #[doc(alias = "HMPresenceEventUserTypeCurrentUser")]
55    pub const CurrentUser: Self = Self(1);
56    /// Presence of all home users is used.
57    #[doc(alias = "HMPresenceEventUserTypeHomeUsers")]
58    pub const HomeUsers: Self = Self(2);
59    /// Presence of custom set of home users is used.
60    #[doc(alias = "HMPresenceEventUserTypeCustomUsers")]
61    pub const CustomUsers: Self = Self(3);
62}
63
64unsafe impl Encode for HMPresenceEventUserType {
65    const ENCODING: Encoding = NSUInteger::ENCODING;
66}
67
68unsafe impl RefEncode for HMPresenceEventUserType {
69    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
70}