objc2_home_kit/generated/
HMNetworkConfigurationProfile.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::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/homekit/hmnetworkconfigurationprofile?language=objc)
11    #[unsafe(super(HMAccessoryProfile, NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    #[cfg(feature = "HMAccessoryProfile")]
14    pub struct HMNetworkConfigurationProfile;
15);
16
17#[cfg(feature = "HMAccessoryProfile")]
18unsafe impl Send for HMNetworkConfigurationProfile {}
19
20#[cfg(feature = "HMAccessoryProfile")]
21unsafe impl Sync for HMNetworkConfigurationProfile {}
22
23#[cfg(feature = "HMAccessoryProfile")]
24extern_conformance!(
25    unsafe impl NSObjectProtocol for HMNetworkConfigurationProfile {}
26);
27
28#[cfg(feature = "HMAccessoryProfile")]
29impl HMNetworkConfigurationProfile {
30    extern_methods!(
31        /// The delegate of the receiver.
32        ///
33        /// This property is not atomic.
34        ///
35        /// # Safety
36        ///
37        /// This might not be thread-safe.
38        #[unsafe(method(delegate))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn delegate(
41            &self,
42        ) -> Option<Retained<ProtocolObject<dyn HMNetworkConfigurationProfileDelegate>>>;
43
44        /// Setter for [`delegate`][Self::delegate].
45        ///
46        /// This is a [weak property][objc2::topics::weak_property].
47        ///
48        /// # Safety
49        ///
50        /// This might not be thread-safe.
51        #[unsafe(method(setDelegate:))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn setDelegate(
54            &self,
55            delegate: Option<&ProtocolObject<dyn HMNetworkConfigurationProfileDelegate>>,
56        );
57
58        /// Indicates if the associated accessory's access to the network is restricted.
59        ///
60        /// This property is not atomic.
61        ///
62        /// # Safety
63        ///
64        /// This might not be thread-safe.
65        #[unsafe(method(isNetworkAccessRestricted))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn isNetworkAccessRestricted(&self) -> bool;
68
69        #[unsafe(method(init))]
70        #[unsafe(method_family = init)]
71        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
72    );
73}
74
75/// Methods declared on superclass `NSObject`.
76#[cfg(feature = "HMAccessoryProfile")]
77impl HMNetworkConfigurationProfile {
78    extern_methods!(
79        #[unsafe(method(new))]
80        #[unsafe(method_family = new)]
81        pub unsafe fn new() -> Retained<Self>;
82    );
83}
84
85extern_protocol!(
86    /// [Apple's documentation](https://developer.apple.com/documentation/homekit/hmnetworkconfigurationprofiledelegate?language=objc)
87    pub unsafe trait HMNetworkConfigurationProfileDelegate: NSObjectProtocol {
88        #[cfg(feature = "HMAccessoryProfile")]
89        /// Informs the delegate that the network access mode has updated.
90        ///
91        ///
92        /// Parameter `profile`: Sender of the message.
93        #[optional]
94        #[unsafe(method(profileDidUpdateNetworkAccessMode:))]
95        #[unsafe(method_family = none)]
96        unsafe fn profileDidUpdateNetworkAccessMode(&self, profile: &HMNetworkConfigurationProfile);
97    }
98);