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 crate::*;

extern_class!(
    /// Represents the access control of a user associated with a home.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmhomeaccesscontrol?language=objc)
    #[unsafe(super(HMAccessControl, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "HMAccessControl")]
    pub struct HMHomeAccessControl;
);

#[cfg(feature = "HMAccessControl")]
unsafe impl Send for HMHomeAccessControl {}

#[cfg(feature = "HMAccessControl")]
unsafe impl Sync for HMHomeAccessControl {}

#[cfg(feature = "HMAccessControl")]
extern_conformance!(
    unsafe impl NSObjectProtocol for HMHomeAccessControl {}
);

#[cfg(feature = "HMAccessControl")]
impl HMHomeAccessControl {
    extern_methods!(
        /// Specifies if the user has administrative privileges for the home.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(isAdministrator))]
        #[unsafe(method_family = none)]
        pub unsafe fn isAdministrator(&self) -> bool;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

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