// 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};
use glib::{translate::*};

/// Flags that controls what is the certificate chooser button able to pick.
/// Currently only local files are supported, but might be extended to use URIs,
/// such as PKCS\#11 certificate URIs in future as well.
#[cfg(feature = "v1_8")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_8")))]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "NMACertChooserFlags")]
pub enum CertChooserFlags {
    /// No flags
    #[doc(alias = "NMA_CERT_CHOOSER_FLAG_NONE")]
    None,
    /// Only pick a certificate, not a key
    #[doc(alias = "NMA_CERT_CHOOSER_FLAG_CERT")]
    Cert,
    /// Hide all controls but the secrets entries
    #[doc(alias = "NMA_CERT_CHOOSER_FLAG_PASSWORDS")]
    Passwords,
    /// Ensure the chooser only selects regular PEM files
    #[doc(alias = "NMA_CERT_CHOOSER_FLAG_PEM")]
    Pem,
    /// Do not show password entries (Since: 1.8.34)
    #[doc(alias = "NMA_CERT_CHOOSER_FLAG_NO_PASSWORDS")]
    NoPasswords,
#[doc(hidden)]
    __Unknown(i32),
}

#[cfg(feature = "v1_8")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_8")))]
#[doc(hidden)]
impl IntoGlib for CertChooserFlags {
    type GlibType = ffi::NMACertChooserFlags;

    #[inline]
fn into_glib(self) -> ffi::NMACertChooserFlags {
match self {
            Self::None => ffi::NMA_CERT_CHOOSER_FLAG_NONE,
            Self::Cert => ffi::NMA_CERT_CHOOSER_FLAG_CERT,
            Self::Passwords => ffi::NMA_CERT_CHOOSER_FLAG_PASSWORDS,
            Self::Pem => ffi::NMA_CERT_CHOOSER_FLAG_PEM,
            Self::NoPasswords => ffi::NMA_CERT_CHOOSER_FLAG_NO_PASSWORDS,
            Self::__Unknown(value) => value,
}
}
}

#[cfg(feature = "v1_8")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_8")))]
#[doc(hidden)]
impl FromGlib<ffi::NMACertChooserFlags> for CertChooserFlags {
    #[inline]
unsafe fn from_glib(value: ffi::NMACertChooserFlags) -> Self {
        skip_assert_initialized!();
        
match value {
            ffi::NMA_CERT_CHOOSER_FLAG_NONE => Self::None,
            ffi::NMA_CERT_CHOOSER_FLAG_CERT => Self::Cert,
            ffi::NMA_CERT_CHOOSER_FLAG_PASSWORDS => Self::Passwords,
            ffi::NMA_CERT_CHOOSER_FLAG_PEM => Self::Pem,
            ffi::NMA_CERT_CHOOSER_FLAG_NO_PASSWORDS => Self::NoPasswords,
            value => Self::__Unknown(value),
}
}
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "NMAMobileFamily")]
pub enum MobileFamily {
    /// Unknown or invalid network access method
    #[doc(alias = "NMA_MOBILE_FAMILY_UNKNOWN")]
    Unknown,
    /// 3rd Generation Partnership Project (3GPP) network
    #[doc(alias = "NMA_MOBILE_FAMILY_3GPP")]
    _3gpp,
    /// A CDMA network
    #[doc(alias = "NMA_MOBILE_FAMILY_CDMA")]
    Cdma,
#[doc(hidden)]
    __Unknown(i32),
}

#[doc(hidden)]
impl IntoGlib for MobileFamily {
    type GlibType = ffi::NMAMobileFamily;

    #[inline]
fn into_glib(self) -> ffi::NMAMobileFamily {
match self {
            Self::Unknown => ffi::NMA_MOBILE_FAMILY_UNKNOWN,
            Self::_3gpp => ffi::NMA_MOBILE_FAMILY_3GPP,
            Self::Cdma => ffi::NMA_MOBILE_FAMILY_CDMA,
            Self::__Unknown(value) => value,
}
}
}

#[doc(hidden)]
impl FromGlib<ffi::NMAMobileFamily> for MobileFamily {
    #[inline]
unsafe fn from_glib(value: ffi::NMAMobileFamily) -> Self {
        skip_assert_initialized!();
        
match value {
            ffi::NMA_MOBILE_FAMILY_UNKNOWN => Self::Unknown,
            ffi::NMA_MOBILE_FAMILY_3GPP => Self::_3gpp,
            ffi::NMA_MOBILE_FAMILY_CDMA => Self::Cdma,
            value => Self::__Unknown(value),
}
}
}

