nm_rs/auto/
setting_wimax.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir
3// from gtk-girs (https://github.com/gtk-rs/gir-files)
4// DO NOT EDIT
5#![allow(deprecated)]
6
7use crate::{ffi,Setting};
8use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*};
9use std::{boxed::Box as Box_};
10
11glib::wrapper! {
12    /// WiMax Settings
13    ///
14    /// ## Properties
15    ///
16    ///
17    /// #### `mac-address`
18    ///  If specified, this connection will only apply to the WiMAX device whose
19    /// MAC address matches. This property does not change the MAC address of the
20    /// device (known as MAC spoofing).
21    ///
22    /// Readable | Writeable
23    ///
24    ///
25    /// #### `network-name`
26    ///  Network Service Provider (NSP) name of the WiMAX network this connection
27    /// should use.
28    ///
29    /// Readable | Writeable
30    /// <details><summary><h4>Setting</h4></summary>
31    ///
32    ///
33    /// #### `name`
34    ///  The setting's name, which uniquely identifies the setting within the
35    /// connection.  Each setting type has a name unique to that type, for
36    /// example "ppp" or "802-11-wireless" or "802-3-ethernet".
37    ///
38    /// Readable
39    /// </details>
40    ///
41    /// # Implements
42    ///
43    /// [`SettingExt`][trait@crate::prelude::SettingExt]
44    #[doc(alias = "NMSettingWimax")]
45    pub struct SettingWimax(Object<ffi::NMSettingWimax, ffi::NMSettingWimaxClass>) @extends Setting;
46
47    match fn {
48        type_ => || ffi::nm_setting_wimax_get_type(),
49    }
50}
51
52impl SettingWimax {
53    /// Creates a new #NMSettingWimax object with default values.
54    ///
55    /// # Deprecated since 1.2
56    ///
57    /// WiMAX is no longer supported.
58    ///
59    /// # Returns
60    ///
61    /// the new empty #NMSettingWimax object
62    #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")]
63    #[allow(deprecated)]
64    #[doc(alias = "nm_setting_wimax_new")]
65    pub fn new() -> SettingWimax {
66        assert_initialized_main_thread!();
67        unsafe {
68            Setting::from_glib_full(ffi::nm_setting_wimax_new()).unsafe_cast()
69        }
70    }
71
72            // rustdoc-stripper-ignore-next
73            /// Creates a new builder-pattern struct instance to construct [`SettingWimax`] objects.
74            ///
75            /// This method returns an instance of [`SettingWimaxBuilder`](crate::builders::SettingWimaxBuilder) which can be used to create [`SettingWimax`] objects.
76            pub fn builder() -> SettingWimaxBuilder {
77                SettingWimaxBuilder::new()
78            }
79        
80
81    /// Returns the MAC address of a WiMAX device which this connection is locked
82    /// to.
83    ///
84    /// # Deprecated since 1.2
85    ///
86    /// WiMAX is no longer supported.
87    ///
88    /// # Returns
89    ///
90    /// the MAC address
91    #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")]
92    #[allow(deprecated)]
93    #[doc(alias = "nm_setting_wimax_get_mac_address")]
94    #[doc(alias = "get_mac_address")]
95    #[doc(alias = "mac-address")]
96    pub fn mac_address(&self) -> glib::GString {
97        unsafe {
98            from_glib_none(ffi::nm_setting_wimax_get_mac_address(self.to_glib_none().0))
99        }
100    }
101
102    /// Returns the WiMAX NSP name (ex "Sprint" or "CLEAR") which identifies the
103    /// specific WiMAX network this setting describes a connection to.
104    ///
105    /// # Deprecated since 1.2
106    ///
107    /// WiMAX is no longer supported.
108    ///
109    /// # Returns
110    ///
111    /// the WiMAX NSP name
112    #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")]
113    #[allow(deprecated)]
114    #[doc(alias = "nm_setting_wimax_get_network_name")]
115    #[doc(alias = "get_network_name")]
116    #[doc(alias = "network-name")]
117    pub fn network_name(&self) -> glib::GString {
118        unsafe {
119            from_glib_none(ffi::nm_setting_wimax_get_network_name(self.to_glib_none().0))
120        }
121    }
122
123    /// If specified, this connection will only apply to the WiMAX device whose
124    /// MAC address matches. This property does not change the MAC address of the
125    /// device (known as MAC spoofing).
126    ///
127    /// # Deprecated since 1.2
128    ///
129    /// WiMAX is no longer supported.
130    #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")]
131    #[doc(alias = "mac-address")]
132    pub fn set_mac_address(&self, mac_address: Option<&str>) {
133        ObjectExt::set_property(self,"mac-address", mac_address)
134    }
135
136    /// Network Service Provider (NSP) name of the WiMAX network this connection
137    /// should use.
138    ///
139    /// # Deprecated since 1.2
140    ///
141    /// WiMAX is no longer supported.
142    #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")]
143    #[doc(alias = "network-name")]
144    pub fn set_network_name(&self, network_name: Option<&str>) {
145        ObjectExt::set_property(self,"network-name", network_name)
146    }
147
148    #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")]
149    #[doc(alias = "mac-address")]
150    pub fn connect_mac_address_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
151        unsafe extern "C" fn notify_mac_address_trampoline<F: Fn(&SettingWimax) + 'static>(this: *mut ffi::NMSettingWimax, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
152            let f: &F = &*(f as *const F);
153            f(&from_glib_borrow(this))
154        }
155        unsafe {
156            let f: Box_<F> = Box_::new(f);
157            connect_raw(self.as_ptr() as *mut _, c"notify::mac-address".as_ptr() as *const _,
158                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_mac_address_trampoline::<F> as *const ())), Box_::into_raw(f))
159        }
160    }
161
162    #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")]
163    #[doc(alias = "network-name")]
164    pub fn connect_network_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
165        unsafe extern "C" fn notify_network_name_trampoline<F: Fn(&SettingWimax) + 'static>(this: *mut ffi::NMSettingWimax, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
166            let f: &F = &*(f as *const F);
167            f(&from_glib_borrow(this))
168        }
169        unsafe {
170            let f: Box_<F> = Box_::new(f);
171            connect_raw(self.as_ptr() as *mut _, c"notify::network-name".as_ptr() as *const _,
172                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_network_name_trampoline::<F> as *const ())), Box_::into_raw(f))
173        }
174    }
175}
176
177impl Default for SettingWimax {
178                     fn default() -> Self {
179                         Self::new()
180                     }
181                 }
182
183// rustdoc-stripper-ignore-next
184        /// A [builder-pattern] type to construct [`SettingWimax`] objects.
185        ///
186        /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
187#[must_use = "The builder must be built to be used"]
188pub struct SettingWimaxBuilder {
189            builder: glib::object::ObjectBuilder<'static, SettingWimax>,
190        }
191
192        impl SettingWimaxBuilder {
193        fn new() -> Self {
194            Self { builder: glib::object::Object::builder() }
195        }
196
197                            /// If specified, this connection will only apply to the WiMAX device whose
198                            /// MAC address matches. This property does not change the MAC address of the
199                            /// device (known as MAC spoofing).
200                            /// WiMAX is no longer supported.
201                            #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")]
202    pub fn mac_address(self, mac_address: impl Into<glib::GString>) -> Self {
203                            Self { builder: self.builder.property("mac-address", mac_address.into()), }
204                        }
205
206                            /// Network Service Provider (NSP) name of the WiMAX network this connection
207                            /// should use.
208                            /// WiMAX is no longer supported.
209                            #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")]
210    pub fn network_name(self, network_name: impl Into<glib::GString>) -> Self {
211                            Self { builder: self.builder.property("network-name", network_name.into()), }
212                        }
213
214    // rustdoc-stripper-ignore-next
215    /// Build the [`SettingWimax`].
216    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
217    pub fn build(self) -> SettingWimax {
218assert_initialized_main_thread!();
219    self.builder.build() }
220}