objc2_core_wlan/generated/CWConfiguration.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 the system configuration for a given Wi-Fi interface.
12 ///
13 ///
14 /// The CWConfiguration class contains basic network configuration settings and also the list of preferred networks.
15 /// CWConfiguration is an immutable object. For changing configuration settings and/or the preferred networks list, see CWMutableConfiguration.
16 ///
17 /// See also [Apple's documentation](https://developer.apple.com/documentation/corewlan/cwconfiguration?language=objc)
18 #[unsafe(super(NSObject))]
19 #[derive(Debug, PartialEq, Eq, Hash)]
20 pub struct CWConfiguration;
21);
22
23extern_conformance!(
24 unsafe impl NSCoding for CWConfiguration {}
25);
26
27extern_conformance!(
28 unsafe impl NSCopying for CWConfiguration {}
29);
30
31unsafe impl CopyingHelper for CWConfiguration {
32 type Result = Self;
33}
34
35extern_conformance!(
36 unsafe impl NSMutableCopying for CWConfiguration {}
37);
38
39unsafe impl MutableCopyingHelper for CWConfiguration {
40 type Result = CWMutableConfiguration;
41}
42
43extern_conformance!(
44 unsafe impl NSObjectProtocol for CWConfiguration {}
45);
46
47extern_conformance!(
48 unsafe impl NSSecureCoding for CWConfiguration {}
49);
50
51impl CWConfiguration {
52 extern_methods!(
53 #[cfg(feature = "CWNetworkProfile")]
54 /// Returns: An NSOrderedSet of CWNetworkProfile objects.
55 ///
56 ///
57 /// Returns the preferred networks list.
58 ///
59 ///
60 /// The order of the ordered set corresponds to the order the preferred networks list.
61 #[unsafe(method(networkProfiles))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn networkProfiles(&self) -> Retained<NSOrderedSet<CWNetworkProfile>>;
64
65 /// Returns: YES if the preference is enabled, NO otherwise.
66 ///
67 ///
68 /// Returns the preference to require an administrator password to change networks.
69 ///
70 ///
71 /// If YES, the user may be prompted to enter an administrator password upon attempting to join a Wi-Fi network.
72 /// This preference is enforced at the API layer.
73 #[unsafe(method(requireAdministratorForAssociation))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn requireAdministratorForAssociation(&self) -> bool;
76
77 /// Returns: YES if the preference is enabled, NO otherwise.
78 ///
79 ///
80 /// Returns the preference to require an administrator password to change the interface power state.
81 ///
82 ///
83 /// If YES, the user may be prompted to enter an administrator password upon attempting to turn Wi-Fi on or off.
84 /// This preference is enforced at the API layer.
85 #[unsafe(method(requireAdministratorForPower))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn requireAdministratorForPower(&self) -> bool;
88
89 /// Returns: YES if the preference is enabled, NO otherwise.
90 ///
91 ///
92 /// Returns the preference to require an administrator password to create a computer-to-computer network.
93 ///
94 ///
95 /// If YES, the user may be prompted to enter an administrator password upon attempting to create an IBSS network.
96 /// This preference is enforced at the API layer.
97 #[unsafe(method(requireAdministratorForIBSSMode))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn requireAdministratorForIBSSMode(&self) -> bool;
100
101 /// Returns: YES if the preference is enabled, NO otherwise.
102 ///
103 ///
104 /// Returns the preference to remember all Wi-Fi networks joined unless otherwise specified by the user when joining a particular Wi-Fi network.
105 #[unsafe(method(rememberJoinedNetworks))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn rememberJoinedNetworks(&self) -> bool;
108
109 /// Convenience method for getting a CWConfiguration object.
110 #[unsafe(method(configuration))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn configuration() -> Retained<Self>;
113
114 /// Initializes a CWConfiguration object.
115 #[unsafe(method(init))]
116 #[unsafe(method_family = init)]
117 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
118
119 /// Parameter `configuration`: A CWConfiguration object.
120 ///
121 ///
122 /// Returns: A CWConfiguration object.
123 ///
124 ///
125 /// Initializes a CWConfiguration object with the properties of an existing CWConfiguration object.
126 #[unsafe(method(initWithConfiguration:))]
127 #[unsafe(method_family = init)]
128 pub unsafe fn initWithConfiguration(
129 this: Allocated<Self>,
130 configuration: &CWConfiguration,
131 ) -> Retained<Self>;
132
133 /// Parameter `configuration`: A CWConfiguration object.
134 ///
135 ///
136 /// Returns: A CWConfiguration object.
137 ///
138 ///
139 /// Convenience method for getting a CWConfiguration object initialized with the properties of an existing CWConfiguration object.
140 #[unsafe(method(configurationWithConfiguration:))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn configurationWithConfiguration(
143 configuration: &CWConfiguration,
144 ) -> Retained<Self>;
145
146 /// Parameter `configuration`: The CWConfiguration with which to compare the receiver.
147 ///
148 ///
149 /// Returns: YES if the objects are equal, NO otherwise.
150 ///
151 ///
152 /// Determine CWConfiguration equality.
153 ///
154 ///
155 /// CWConfiguration objects are considered equal if all their corresponding properties are equal.
156 #[unsafe(method(isEqualToConfiguration:))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn isEqualToConfiguration(&self, configuration: &CWConfiguration) -> bool;
159 );
160}
161
162/// Methods declared on superclass `NSObject`.
163impl CWConfiguration {
164 extern_methods!(
165 #[unsafe(method(new))]
166 #[unsafe(method_family = new)]
167 pub unsafe fn new() -> Retained<Self>;
168 );
169}
170
171extern_class!(
172 /// Mutable subclass of CWConfiguration. Use this class for changing configuration settings and/or the preferred networks list.
173 ///
174 ///
175 /// To commit configuration changes, use -[CWInterface commitConfiguration:authorization:error:].
176 ///
177 /// See also [Apple's documentation](https://developer.apple.com/documentation/corewlan/cwmutableconfiguration?language=objc)
178 #[unsafe(super(CWConfiguration, NSObject))]
179 #[derive(Debug, PartialEq, Eq, Hash)]
180 pub struct CWMutableConfiguration;
181);
182
183extern_conformance!(
184 unsafe impl NSCoding for CWMutableConfiguration {}
185);
186
187extern_conformance!(
188 unsafe impl NSCopying for CWMutableConfiguration {}
189);
190
191unsafe impl CopyingHelper for CWMutableConfiguration {
192 type Result = CWConfiguration;
193}
194
195extern_conformance!(
196 unsafe impl NSMutableCopying for CWMutableConfiguration {}
197);
198
199unsafe impl MutableCopyingHelper for CWMutableConfiguration {
200 type Result = Self;
201}
202
203extern_conformance!(
204 unsafe impl NSObjectProtocol for CWMutableConfiguration {}
205);
206
207extern_conformance!(
208 unsafe impl NSSecureCoding for CWMutableConfiguration {}
209);
210
211impl CWMutableConfiguration {
212 extern_methods!(
213 #[cfg(feature = "CWNetworkProfile")]
214 /// Add, remove, or update the preferred networks list.
215 #[unsafe(method(networkProfiles))]
216 #[unsafe(method_family = none)]
217 pub unsafe fn networkProfiles(&self) -> Retained<NSOrderedSet<CWNetworkProfile>>;
218
219 #[cfg(feature = "CWNetworkProfile")]
220 /// Setter for [`networkProfiles`][Self::networkProfiles].
221 #[unsafe(method(setNetworkProfiles:))]
222 #[unsafe(method_family = none)]
223 pub unsafe fn setNetworkProfiles(&self, network_profiles: &NSOrderedSet<CWNetworkProfile>);
224
225 /// Set the preference to require an administrator password to change networks.
226 #[unsafe(method(requireAdministratorForAssociation))]
227 #[unsafe(method_family = none)]
228 pub unsafe fn requireAdministratorForAssociation(&self) -> bool;
229
230 /// Setter for [`requireAdministratorForAssociation`][Self::requireAdministratorForAssociation].
231 #[unsafe(method(setRequireAdministratorForAssociation:))]
232 #[unsafe(method_family = none)]
233 pub unsafe fn setRequireAdministratorForAssociation(
234 &self,
235 require_administrator_for_association: bool,
236 );
237
238 /// Set the preference to require an administrator password to change the interface power state.
239 #[unsafe(method(requireAdministratorForPower))]
240 #[unsafe(method_family = none)]
241 pub unsafe fn requireAdministratorForPower(&self) -> bool;
242
243 /// Setter for [`requireAdministratorForPower`][Self::requireAdministratorForPower].
244 #[unsafe(method(setRequireAdministratorForPower:))]
245 #[unsafe(method_family = none)]
246 pub unsafe fn setRequireAdministratorForPower(&self, require_administrator_for_power: bool);
247
248 /// Set the preference to require an administrator password to change networks.
249 #[deprecated]
250 #[unsafe(method(requireAdministratorForIBSSMode))]
251 #[unsafe(method_family = none)]
252 pub unsafe fn requireAdministratorForIBSSMode(&self) -> bool;
253
254 /// Setter for [`requireAdministratorForIBSSMode`][Self::requireAdministratorForIBSSMode].
255 #[deprecated]
256 #[unsafe(method(setRequireAdministratorForIBSSMode:))]
257 #[unsafe(method_family = none)]
258 pub unsafe fn setRequireAdministratorForIBSSMode(
259 &self,
260 require_administrator_for_ibss_mode: bool,
261 );
262
263 /// Set the preference to require an administrator password to create a computer-to-computer network.
264 #[unsafe(method(rememberJoinedNetworks))]
265 #[unsafe(method_family = none)]
266 pub unsafe fn rememberJoinedNetworks(&self) -> bool;
267
268 /// Setter for [`rememberJoinedNetworks`][Self::rememberJoinedNetworks].
269 #[unsafe(method(setRememberJoinedNetworks:))]
270 #[unsafe(method_family = none)]
271 pub unsafe fn setRememberJoinedNetworks(&self, remember_joined_networks: bool);
272 );
273}
274
275/// Methods declared on superclass `CWConfiguration`.
276impl CWMutableConfiguration {
277 extern_methods!(
278 /// Convenience method for getting a CWConfiguration object.
279 #[unsafe(method(configuration))]
280 #[unsafe(method_family = none)]
281 pub unsafe fn configuration() -> Retained<Self>;
282
283 /// Initializes a CWConfiguration object.
284 #[unsafe(method(init))]
285 #[unsafe(method_family = init)]
286 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
287
288 /// Parameter `configuration`: A CWConfiguration object.
289 ///
290 ///
291 /// Returns: A CWConfiguration object.
292 ///
293 ///
294 /// Initializes a CWConfiguration object with the properties of an existing CWConfiguration object.
295 #[unsafe(method(initWithConfiguration:))]
296 #[unsafe(method_family = init)]
297 pub unsafe fn initWithConfiguration(
298 this: Allocated<Self>,
299 configuration: &CWConfiguration,
300 ) -> Retained<Self>;
301
302 /// Parameter `configuration`: A CWConfiguration object.
303 ///
304 ///
305 /// Returns: A CWConfiguration object.
306 ///
307 ///
308 /// Convenience method for getting a CWConfiguration object initialized with the properties of an existing CWConfiguration object.
309 #[unsafe(method(configurationWithConfiguration:))]
310 #[unsafe(method_family = none)]
311 pub unsafe fn configurationWithConfiguration(
312 configuration: &CWConfiguration,
313 ) -> Retained<Self>;
314 );
315}
316
317/// Methods declared on superclass `NSObject`.
318impl CWMutableConfiguration {
319 extern_methods!(
320 #[unsafe(method(new))]
321 #[unsafe(method_family = new)]
322 pub unsafe fn new() -> Retained<Self>;
323 );
324}