objc2_core_wlan/generated/
CWNetworkProfile.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    /// Encapsulates a preferred network entry.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/corewlan/cwnetworkprofile?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct CWNetworkProfile;
17);
18
19extern_conformance!(
20    unsafe impl NSCoding for CWNetworkProfile {}
21);
22
23extern_conformance!(
24    unsafe impl NSCopying for CWNetworkProfile {}
25);
26
27unsafe impl CopyingHelper for CWNetworkProfile {
28    type Result = Self;
29}
30
31extern_conformance!(
32    unsafe impl NSMutableCopying for CWNetworkProfile {}
33);
34
35unsafe impl MutableCopyingHelper for CWNetworkProfile {
36    type Result = CWMutableNetworkProfile;
37}
38
39extern_conformance!(
40    unsafe impl NSObjectProtocol for CWNetworkProfile {}
41);
42
43extern_conformance!(
44    unsafe impl NSSecureCoding for CWNetworkProfile {}
45);
46
47impl CWNetworkProfile {
48    extern_methods!(
49        /// Returns the service set identifier (SSID) for the Wi-Fi network profile, encoded as a string.
50        ///
51        ///
52        /// Returns nil if the SSID can not be encoded as a valid UTF-8 or WinLatin1 string.
53        #[unsafe(method(ssid))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn ssid(&self) -> Option<Retained<NSString>>;
56
57        /// Returns the service set identifier (SSID) for the Wi-Fi network profile, encapsulated in an NSData object.
58        ///
59        ///
60        /// The SSID is 1-32 octets.
61        #[unsafe(method(ssidData))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn ssidData(&self) -> Option<Retained<NSData>>;
64
65        #[cfg(feature = "CoreWLANTypes")]
66        /// Returns the security type of the Wi-Fi network profile.
67        #[unsafe(method(security))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn security(&self) -> CWSecurity;
70
71        /// Convenience method for getting a CWNetworkProfile object.
72        #[unsafe(method(networkProfile))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn networkProfile() -> Retained<Self>;
75
76        /// Initializes a CWNetworkProfile object.
77        #[unsafe(method(init))]
78        #[unsafe(method_family = init)]
79        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
80
81        /// Parameter `networkProfile`: A CWNetworkProfile object.
82        ///
83        ///
84        /// Returns: A CWNetworkProfile object.
85        ///
86        ///
87        /// Initializes a CWNetworkProfile object with the properties of an existing CWNetworkProfile object.
88        #[unsafe(method(initWithNetworkProfile:))]
89        #[unsafe(method_family = init)]
90        pub unsafe fn initWithNetworkProfile(
91            this: Allocated<Self>,
92            network_profile: &CWNetworkProfile,
93        ) -> Retained<Self>;
94
95        /// Parameter `networkProfile`: A CWNetworkProfile object.
96        ///
97        ///
98        /// Returns: A CWNetworkProfile object.
99        ///
100        ///
101        /// Convenience method for getting a CWNetworkProfile object initialized with the properties of an existing CWNetworkProfile object.
102        #[unsafe(method(networkProfileWithNetworkProfile:))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn networkProfileWithNetworkProfile(
105            network_profile: &CWNetworkProfile,
106        ) -> Retained<Self>;
107
108        /// Parameter `network`: A CWNetworkProfile object.
109        ///
110        ///
111        /// Returns: YES if the objects are equal, NO otherwise.
112        ///
113        ///
114        /// Determine CWNetworkProfile equality.
115        ///
116        ///
117        /// CWNetworkProfile objects are considered equal if their corresponding
118        /// <i>
119        /// ssidData
120        /// </i>
121        /// and
122        /// <i>
123        /// security
124        /// </i>
125        /// properties are equal.
126        #[unsafe(method(isEqualToNetworkProfile:))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn isEqualToNetworkProfile(&self, network_profile: &CWNetworkProfile) -> bool;
129    );
130}
131
132/// Methods declared on superclass `NSObject`.
133impl CWNetworkProfile {
134    extern_methods!(
135        #[unsafe(method(new))]
136        #[unsafe(method_family = new)]
137        pub unsafe fn new() -> Retained<Self>;
138    );
139}
140
141extern_class!(
142    /// Mutable subclass of CWNetworkProfile.  Use this class for changing profile properties.
143    ///
144    ///
145    /// To commit Wi-Fi network profile changes, use -[CWMutableConfiguration setNetworkProfiles:] and
146    /// -[CWInterface commitConfiguration:authorization:error:].
147    ///
148    /// See also [Apple's documentation](https://developer.apple.com/documentation/corewlan/cwmutablenetworkprofile?language=objc)
149    #[unsafe(super(CWNetworkProfile, NSObject))]
150    #[derive(Debug, PartialEq, Eq, Hash)]
151    pub struct CWMutableNetworkProfile;
152);
153
154extern_conformance!(
155    unsafe impl NSCoding for CWMutableNetworkProfile {}
156);
157
158extern_conformance!(
159    unsafe impl NSCopying for CWMutableNetworkProfile {}
160);
161
162unsafe impl CopyingHelper for CWMutableNetworkProfile {
163    type Result = CWNetworkProfile;
164}
165
166extern_conformance!(
167    unsafe impl NSMutableCopying for CWMutableNetworkProfile {}
168);
169
170unsafe impl MutableCopyingHelper for CWMutableNetworkProfile {
171    type Result = Self;
172}
173
174extern_conformance!(
175    unsafe impl NSObjectProtocol for CWMutableNetworkProfile {}
176);
177
178extern_conformance!(
179    unsafe impl NSSecureCoding for CWMutableNetworkProfile {}
180);
181
182impl CWMutableNetworkProfile {
183    extern_methods!(
184        /// Set the service set identifier (SSID).
185        #[unsafe(method(ssidData))]
186        #[unsafe(method_family = none)]
187        pub unsafe fn ssidData(&self) -> Option<Retained<NSData>>;
188
189        /// Setter for [`ssidData`][Self::ssidData].
190        #[unsafe(method(setSsidData:))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn setSsidData(&self, ssid_data: Option<&NSData>);
193
194        #[cfg(feature = "CoreWLANTypes")]
195        /// Set the security type.
196        #[unsafe(method(security))]
197        #[unsafe(method_family = none)]
198        pub unsafe fn security(&self) -> CWSecurity;
199
200        #[cfg(feature = "CoreWLANTypes")]
201        /// Setter for [`security`][Self::security].
202        #[unsafe(method(setSecurity:))]
203        #[unsafe(method_family = none)]
204        pub unsafe fn setSecurity(&self, security: CWSecurity);
205    );
206}
207
208/// Methods declared on superclass `CWNetworkProfile`.
209impl CWMutableNetworkProfile {
210    extern_methods!(
211        /// Convenience method for getting a CWNetworkProfile object.
212        #[unsafe(method(networkProfile))]
213        #[unsafe(method_family = none)]
214        pub unsafe fn networkProfile() -> Retained<Self>;
215
216        /// Initializes a CWNetworkProfile object.
217        #[unsafe(method(init))]
218        #[unsafe(method_family = init)]
219        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
220
221        /// Parameter `networkProfile`: A CWNetworkProfile object.
222        ///
223        ///
224        /// Returns: A CWNetworkProfile object.
225        ///
226        ///
227        /// Initializes a CWNetworkProfile object with the properties of an existing CWNetworkProfile object.
228        #[unsafe(method(initWithNetworkProfile:))]
229        #[unsafe(method_family = init)]
230        pub unsafe fn initWithNetworkProfile(
231            this: Allocated<Self>,
232            network_profile: &CWNetworkProfile,
233        ) -> Retained<Self>;
234
235        /// Parameter `networkProfile`: A CWNetworkProfile object.
236        ///
237        ///
238        /// Returns: A CWNetworkProfile object.
239        ///
240        ///
241        /// Convenience method for getting a CWNetworkProfile object initialized with the properties of an existing CWNetworkProfile object.
242        #[unsafe(method(networkProfileWithNetworkProfile:))]
243        #[unsafe(method_family = none)]
244        pub unsafe fn networkProfileWithNetworkProfile(
245            network_profile: &CWNetworkProfile,
246        ) -> Retained<Self>;
247    );
248}
249
250/// Methods declared on superclass `NSObject`.
251impl CWMutableNetworkProfile {
252    extern_methods!(
253        #[unsafe(method(new))]
254        #[unsafe(method_family = new)]
255        pub unsafe fn new() -> Retained<Self>;
256    );
257}