objc2_home_kit/generated/
HMRoom.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// This class describes a room in the home.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmroom?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct HMRoom;
17);
18
19unsafe impl Send for HMRoom {}
20
21unsafe impl Sync for HMRoom {}
22
23unsafe impl NSObjectProtocol for HMRoom {}
24
25impl HMRoom {
26    extern_methods!(
27        #[unsafe(method(init))]
28        #[unsafe(method_family = init)]
29        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
30
31        /// Name of the room.
32        #[unsafe(method(name))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn name(&self) -> Retained<NSString>;
35
36        #[cfg(feature = "HMAccessory")]
37        /// Array of HMAccessory objects that correspond to the accessories
38        /// associated with this room.
39        #[unsafe(method(accessories))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn accessories(&self) -> Retained<NSArray<HMAccessory>>;
42
43        /// A unique identifier for the room.
44        #[unsafe(method(uniqueIdentifier))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn uniqueIdentifier(&self) -> Retained<NSUUID>;
47
48        #[cfg(feature = "block2")]
49        /// This method is used to change the name of the room.
50        ///
51        ///
52        /// Parameter `name`: New name for the room.
53        ///
54        ///
55        /// Parameter `completion`: Block that is invoked once the request is processed.
56        /// The NSError provides more information on the status of the request, error
57        /// will be nil on success.
58        #[unsafe(method(updateName:completionHandler:))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn updateName_completionHandler(
61            &self,
62            name: &NSString,
63            completion: &block2::Block<dyn Fn(*mut NSError)>,
64        );
65    );
66}
67
68/// Methods declared on superclass `NSObject`.
69impl HMRoom {
70    extern_methods!(
71        #[unsafe(method(new))]
72        #[unsafe(method_family = new)]
73        pub unsafe fn new() -> Retained<Self>;
74    );
75}