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")]
24unsafe impl NSObjectProtocol for HMNetworkConfigurationProfile {}
25
26#[cfg(feature = "HMAccessoryProfile")]
27impl HMNetworkConfigurationProfile {
28    extern_methods!(
29        /// The delegate of the receiver.
30        #[unsafe(method(delegate))]
31        #[unsafe(method_family = none)]
32        pub unsafe fn delegate(
33            &self,
34        ) -> Option<Retained<ProtocolObject<dyn HMNetworkConfigurationProfileDelegate>>>;
35
36        /// This is a [weak property][objc2::topics::weak_property].
37        /// Setter for [`delegate`][Self::delegate].
38        #[unsafe(method(setDelegate:))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn setDelegate(
41            &self,
42            delegate: Option<&ProtocolObject<dyn HMNetworkConfigurationProfileDelegate>>,
43        );
44
45        /// Indicates if the associated accessory's access to the network is restricted.
46        #[unsafe(method(isNetworkAccessRestricted))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn isNetworkAccessRestricted(&self) -> bool;
49
50        #[unsafe(method(init))]
51        #[unsafe(method_family = init)]
52        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
53    );
54}
55
56/// Methods declared on superclass `NSObject`.
57#[cfg(feature = "HMAccessoryProfile")]
58impl HMNetworkConfigurationProfile {
59    extern_methods!(
60        #[unsafe(method(new))]
61        #[unsafe(method_family = new)]
62        pub unsafe fn new() -> Retained<Self>;
63    );
64}
65
66extern_protocol!(
67    /// [Apple's documentation](https://developer.apple.com/documentation/homekit/hmnetworkconfigurationprofiledelegate?language=objc)
68    pub unsafe trait HMNetworkConfigurationProfileDelegate: NSObjectProtocol {
69        #[cfg(feature = "HMAccessoryProfile")]
70        /// Informs the delegate that the network access mode has updated.
71        ///
72        ///
73        /// Parameter `profile`: Sender of the message.
74        #[optional]
75        #[unsafe(method(profileDidUpdateNetworkAccessMode:))]
76        #[unsafe(method_family = none)]
77        unsafe fn profileDidUpdateNetworkAccessMode(&self, profile: &HMNetworkConfigurationProfile);
78    }
79);