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