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        ///
191        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
192        #[unsafe(method(setSsidData:))]
193        #[unsafe(method_family = none)]
194        pub unsafe fn setSsidData(&self, ssid_data: Option<&NSData>);
195
196        #[cfg(feature = "CoreWLANTypes")]
197        /// Set the security type.
198        #[unsafe(method(security))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn security(&self) -> CWSecurity;
201
202        #[cfg(feature = "CoreWLANTypes")]
203        /// Setter for [`security`][Self::security].
204        #[unsafe(method(setSecurity:))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn setSecurity(&self, security: CWSecurity);
207    );
208}
209
210/// Methods declared on superclass `CWNetworkProfile`.
211impl CWMutableNetworkProfile {
212    extern_methods!(
213        /// Convenience method for getting a CWNetworkProfile object.
214        #[unsafe(method(networkProfile))]
215        #[unsafe(method_family = none)]
216        pub unsafe fn networkProfile() -> Retained<Self>;
217
218        /// Initializes a CWNetworkProfile object.
219        #[unsafe(method(init))]
220        #[unsafe(method_family = init)]
221        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
222
223        /// Parameter `networkProfile`: A CWNetworkProfile object.
224        ///
225        ///
226        /// Returns: A CWNetworkProfile object.
227        ///
228        ///
229        /// Initializes a CWNetworkProfile object with the properties of an existing CWNetworkProfile object.
230        #[unsafe(method(initWithNetworkProfile:))]
231        #[unsafe(method_family = init)]
232        pub unsafe fn initWithNetworkProfile(
233            this: Allocated<Self>,
234            network_profile: &CWNetworkProfile,
235        ) -> Retained<Self>;
236
237        /// Parameter `networkProfile`: A CWNetworkProfile object.
238        ///
239        ///
240        /// Returns: A CWNetworkProfile object.
241        ///
242        ///
243        /// Convenience method for getting a CWNetworkProfile object initialized with the properties of an existing CWNetworkProfile object.
244        #[unsafe(method(networkProfileWithNetworkProfile:))]
245        #[unsafe(method_family = none)]
246        pub unsafe fn networkProfileWithNetworkProfile(
247            network_profile: &CWNetworkProfile,
248        ) -> Retained<Self>;
249    );
250}
251
252/// Methods declared on superclass `NSObject`.
253impl CWMutableNetworkProfile {
254    extern_methods!(
255        #[unsafe(method(new))]
256        #[unsafe(method_family = new)]
257        pub unsafe fn new() -> Retained<Self>;
258    );
259}