nma4/auto/
mobile_wizard.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from girs
3// from gtk-girs (https://github.com/gtk-rs/gir-files)
4// DO NOT EDIT
5
6use crate::{ffi,MobileWizardAccessMethod};
7use glib::{prelude::*,translate::*};
8use std::{boxed::Box as Box_};
9
10glib::wrapper! {
11    ///
12    #[doc(alias = "NMAMobileWizard")]
13    pub struct MobileWizard(Object<ffi::NMAMobileWizard, ffi::NMAMobileWizardClass>);
14
15    match fn {
16        type_ => || ffi::nma_mobile_wizard_get_type(),
17    }
18}
19
20impl MobileWizard {
21    ///
22    /// # Returns
23    ///
24    /// the newly created #NMAMobileWizard
25    #[doc(alias = "nma_mobile_wizard_new")]
26    pub fn new<P: FnOnce(&MobileWizard, bool, &MobileWizardAccessMethod) + 'static>(parent: &impl IsA<gtk::Window>, window_group: &impl IsA<gtk::WindowGroup>, modem_caps: nm::DeviceModemCapabilities, will_connect_after: bool, cb: P) -> MobileWizard {
27        assert_initialized_main_thread!();
28        let cb_data: Box_<P> = Box_::new(cb);
29        unsafe extern "C" fn cb_func<P: FnOnce(&MobileWizard, bool, &MobileWizardAccessMethod) + 'static>(self_: *mut ffi::NMAMobileWizard, canceled: glib::ffi::gboolean, method: *mut ffi::NMAMobileWizardAccessMethod, user_data: glib::ffi::gpointer) {
30            let self_ = from_glib_borrow(self_);
31            let canceled = from_glib(canceled);
32            let method = from_glib_borrow(method);
33            let callback = Box_::from_raw(user_data as *mut P);
34            (*callback)(&self_, canceled, &method)
35        }
36        let cb = Some(cb_func::<P> as _);
37        let super_callback0: Box_<P> = cb_data;
38        unsafe {
39            from_glib_full(ffi::nma_mobile_wizard_new(parent.as_ref().to_glib_none().0, window_group.as_ref().to_glib_none().0, modem_caps.into_glib(), will_connect_after.into_glib(), cb, Box_::into_raw(super_callback0) as *mut _))
40        }
41    }
42
43    #[doc(alias = "nma_mobile_wizard_destroy")]
44    pub fn destroy(&self) {
45        unsafe {
46            ffi::nma_mobile_wizard_destroy(self.to_glib_none().0);
47        }
48    }
49
50    #[doc(alias = "nma_mobile_wizard_present")]
51    pub fn present(&self) {
52        unsafe {
53            ffi::nma_mobile_wizard_present(self.to_glib_none().0);
54        }
55    }
56}