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        ///
222        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
223        #[unsafe(method(setNetworkProfiles:))]
224        #[unsafe(method_family = none)]
225        pub unsafe fn setNetworkProfiles(&self, network_profiles: &NSOrderedSet<CWNetworkProfile>);
226
227        /// Set the preference to require an administrator password to change networks.
228        #[unsafe(method(requireAdministratorForAssociation))]
229        #[unsafe(method_family = none)]
230        pub unsafe fn requireAdministratorForAssociation(&self) -> bool;
231
232        /// Setter for [`requireAdministratorForAssociation`][Self::requireAdministratorForAssociation].
233        #[unsafe(method(setRequireAdministratorForAssociation:))]
234        #[unsafe(method_family = none)]
235        pub unsafe fn setRequireAdministratorForAssociation(
236            &self,
237            require_administrator_for_association: bool,
238        );
239
240        /// Set the preference to require an administrator password to change the interface power state.
241        #[unsafe(method(requireAdministratorForPower))]
242        #[unsafe(method_family = none)]
243        pub unsafe fn requireAdministratorForPower(&self) -> bool;
244
245        /// Setter for [`requireAdministratorForPower`][Self::requireAdministratorForPower].
246        #[unsafe(method(setRequireAdministratorForPower:))]
247        #[unsafe(method_family = none)]
248        pub unsafe fn setRequireAdministratorForPower(&self, require_administrator_for_power: bool);
249
250        /// Set the preference to require an administrator password to change networks.
251        #[deprecated]
252        #[unsafe(method(requireAdministratorForIBSSMode))]
253        #[unsafe(method_family = none)]
254        pub unsafe fn requireAdministratorForIBSSMode(&self) -> bool;
255
256        /// Setter for [`requireAdministratorForIBSSMode`][Self::requireAdministratorForIBSSMode].
257        #[deprecated]
258        #[unsafe(method(setRequireAdministratorForIBSSMode:))]
259        #[unsafe(method_family = none)]
260        pub unsafe fn setRequireAdministratorForIBSSMode(
261            &self,
262            require_administrator_for_ibss_mode: bool,
263        );
264
265        /// Set the preference to require an administrator password to create a computer-to-computer network.
266        #[unsafe(method(rememberJoinedNetworks))]
267        #[unsafe(method_family = none)]
268        pub unsafe fn rememberJoinedNetworks(&self) -> bool;
269
270        /// Setter for [`rememberJoinedNetworks`][Self::rememberJoinedNetworks].
271        #[unsafe(method(setRememberJoinedNetworks:))]
272        #[unsafe(method_family = none)]
273        pub unsafe fn setRememberJoinedNetworks(&self, remember_joined_networks: bool);
274    );
275}
276
277/// Methods declared on superclass `CWConfiguration`.
278impl CWMutableConfiguration {
279    extern_methods!(
280        /// Convenience method for getting a CWConfiguration object.
281        #[unsafe(method(configuration))]
282        #[unsafe(method_family = none)]
283        pub unsafe fn configuration() -> Retained<Self>;
284
285        /// Initializes a CWConfiguration object.
286        #[unsafe(method(init))]
287        #[unsafe(method_family = init)]
288        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
289
290        /// Parameter `configuration`: A CWConfiguration object.
291        ///
292        ///
293        /// Returns: A CWConfiguration object.
294        ///
295        ///
296        /// Initializes a CWConfiguration object with the properties of an existing CWConfiguration object.
297        #[unsafe(method(initWithConfiguration:))]
298        #[unsafe(method_family = init)]
299        pub unsafe fn initWithConfiguration(
300            this: Allocated<Self>,
301            configuration: &CWConfiguration,
302        ) -> Retained<Self>;
303
304        /// Parameter `configuration`: A CWConfiguration object.
305        ///
306        ///
307        /// Returns: A CWConfiguration object.
308        ///
309        ///
310        /// Convenience method for getting a CWConfiguration object initialized with the properties of an existing CWConfiguration object.
311        #[unsafe(method(configurationWithConfiguration:))]
312        #[unsafe(method_family = none)]
313        pub unsafe fn configurationWithConfiguration(
314            configuration: &CWConfiguration,
315        ) -> Retained<Self>;
316    );
317}
318
319/// Methods declared on superclass `NSObject`.
320impl CWMutableConfiguration {
321    extern_methods!(
322        #[unsafe(method(new))]
323        #[unsafe(method_family = new)]
324        pub unsafe fn new() -> Retained<Self>;
325    );
326}