nma4 0.1.2

Rust bindings for the libnma library.
Documentation
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from girs
// from gtk-girs (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use crate::{ffi,MobileWizardAccessMethod};
use glib::{prelude::*,translate::*};
use std::{boxed::Box as Box_};

glib::wrapper! {
    ///
    #[doc(alias = "NMAMobileWizard")]
    pub struct MobileWizard(Object<ffi::NMAMobileWizard, ffi::NMAMobileWizardClass>);

    match fn {
        type_ => || ffi::nma_mobile_wizard_get_type(),
    }
}

impl MobileWizard {
    ///
    /// # Returns
    ///
    /// the newly created #NMAMobileWizard
    #[doc(alias = "nma_mobile_wizard_new")]
    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 {
        assert_initialized_main_thread!();
        let cb_data: Box_<P> = Box_::new(cb);
        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) {
            let self_ = from_glib_borrow(self_);
            let canceled = from_glib(canceled);
            let method = from_glib_borrow(method);
            let callback = Box_::from_raw(user_data as *mut P);
            (*callback)(&self_, canceled, &method)
        }
        let cb = Some(cb_func::<P> as _);
        let super_callback0: Box_<P> = cb_data;
        unsafe {
            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 _))
        }
    }

    #[doc(alias = "nma_mobile_wizard_destroy")]
    pub fn destroy(&self) {
        unsafe {
            ffi::nma_mobile_wizard_destroy(self.to_glib_none().0);
        }
    }

    #[doc(alias = "nma_mobile_wizard_present")]
    pub fn present(&self) {
        unsafe {
            ffi::nma_mobile_wizard_present(self.to_glib_none().0);
        }
    }
}