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
23extern_conformance!(
24    unsafe impl NSObjectProtocol for HMRoom {}
25);
26
27impl HMRoom {
28    extern_methods!(
29        #[unsafe(method(init))]
30        #[unsafe(method_family = init)]
31        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
32
33        /// Name of the room.
34        #[unsafe(method(name))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn name(&self) -> Retained<NSString>;
37
38        #[cfg(feature = "HMAccessory")]
39        /// Array of HMAccessory objects that correspond to the accessories
40        /// associated with this room.
41        #[unsafe(method(accessories))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn accessories(&self) -> Retained<NSArray<HMAccessory>>;
44
45        /// A unique identifier for the room.
46        #[unsafe(method(uniqueIdentifier))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn uniqueIdentifier(&self) -> Retained<NSUUID>;
49
50        #[cfg(feature = "block2")]
51        /// This method is used to change the name of the room.
52        ///
53        ///
54        /// Parameter `name`: New name for the room.
55        ///
56        ///
57        /// Parameter `completion`: Block that is invoked once the request is processed.
58        /// The NSError provides more information on the status of the request, error
59        /// will be nil on success.
60        #[unsafe(method(updateName:completionHandler:))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn updateName_completionHandler(
63            &self,
64            name: &NSString,
65            completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
66        );
67    );
68}
69
70/// Methods declared on superclass `NSObject`.
71impl HMRoom {
72    extern_methods!(
73        #[unsafe(method(new))]
74        #[unsafe(method_family = new)]
75        pub unsafe fn new() -> Retained<Self>;
76    );
77}