objc2_home_kit/generated/
HMAccessorySetupManager.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 can be used to launch system UI that will allow the user to go through the process
12    /// of adding one or more accessories to a particular home and follow up with additional setup.
13    /// These APIs do not require that the current app has home data authorization
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmaccessorysetupmanager?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct HMAccessorySetupManager;
19);
20
21unsafe impl Send for HMAccessorySetupManager {}
22
23unsafe impl Sync for HMAccessorySetupManager {}
24
25unsafe impl NSObjectProtocol for HMAccessorySetupManager {}
26
27impl HMAccessorySetupManager {
28    extern_methods!(
29        #[unsafe(method(init))]
30        #[unsafe(method_family = init)]
31        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
32
33        #[cfg(all(
34            feature = "HMAccessorySetupRequest",
35            feature = "HMAccessorySetupResult",
36            feature = "block2"
37        ))]
38        /// Launch system UI to perform the process of setting up accessories with the given request.
39        /// During this process, each of the accessories is added to a home, assigned to a room and
40        /// further configured based on its services
41        ///
42        ///
43        /// Parameter `request`: A request object describing information about how to set up the accessory
44        ///
45        /// Parameter `completion`: A block that is invoked once the setup process finishes. On failure, the result will be
46        /// nil and the error will provide additional information
47        #[unsafe(method(performAccessorySetupUsingRequest:completionHandler:))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn performAccessorySetupUsingRequest_completionHandler(
50            &self,
51            request: &HMAccessorySetupRequest,
52            completion: &block2::Block<dyn Fn(*mut HMAccessorySetupResult, *mut NSError)>,
53        );
54    );
55}
56
57/// Methods declared on superclass `NSObject`.
58impl HMAccessorySetupManager {
59    extern_methods!(
60        #[unsafe(method(new))]
61        #[unsafe(method_family = new)]
62        pub unsafe fn new() -> Retained<Self>;
63    );
64}