// This file was generated by gir (https://github.com/gtk-rs/gir)
// from ../../girs
// from ../../gtk-girs
// DO NOT EDIT

use crate::{ffi};
use glib::{prelude::*,translate::*};

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "AstalNotifdClosedReason")]
pub enum ClosedReason {
    #[doc(alias = "ASTAL_NOTIFD_CLOSED_REASON_EXPIRED")]
    Expired,
    #[doc(alias = "ASTAL_NOTIFD_CLOSED_REASON_DISMISSED_BY_USER")]
    DismissedByUser,
    #[doc(alias = "ASTAL_NOTIFD_CLOSED_REASON_CLOSED")]
    Closed,
    #[doc(alias = "ASTAL_NOTIFD_CLOSED_REASON_UNDEFINED")]
    Undefined,
#[doc(hidden)]
    __Unknown(i32),
}

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

    #[inline]
fn into_glib(self) -> ffi::AstalNotifdClosedReason {
match self {
            Self::Expired => ffi::ASTAL_NOTIFD_CLOSED_REASON_EXPIRED,
            Self::DismissedByUser => ffi::ASTAL_NOTIFD_CLOSED_REASON_DISMISSED_BY_USER,
            Self::Closed => ffi::ASTAL_NOTIFD_CLOSED_REASON_CLOSED,
            Self::Undefined => ffi::ASTAL_NOTIFD_CLOSED_REASON_UNDEFINED,
            Self::__Unknown(value) => value,
}
}
}

#[doc(hidden)]
impl FromGlib<ffi::AstalNotifdClosedReason> for ClosedReason {
    #[inline]
unsafe fn from_glib(value: ffi::AstalNotifdClosedReason) -> Self {
        skip_assert_initialized!();
        
match value {
            ffi::ASTAL_NOTIFD_CLOSED_REASON_EXPIRED => Self::Expired,
            ffi::ASTAL_NOTIFD_CLOSED_REASON_DISMISSED_BY_USER => Self::DismissedByUser,
            ffi::ASTAL_NOTIFD_CLOSED_REASON_CLOSED => Self::Closed,
            ffi::ASTAL_NOTIFD_CLOSED_REASON_UNDEFINED => Self::Undefined,
            value => Self::__Unknown(value),
}
}
}

impl StaticType for ClosedReason {
                #[inline]
    #[doc(alias = "astal_notifd_closed_reason_get_type")]
   fn static_type() -> glib::Type {
                    unsafe { from_glib(ffi::astal_notifd_closed_reason_get_type()) }
                }
            }

impl glib::HasParamSpec for ClosedReason {
                type ParamSpec = glib::ParamSpecEnum;
                type SetValue = Self;
                type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
    
                fn param_spec_builder() -> Self::BuilderFn {
                    Self::ParamSpec::builder_with_default
                }
}

impl glib::value::ValueType for ClosedReason {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for ClosedReason {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for ClosedReason {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<ClosedReason> for glib::Value {
    #[inline]
    fn from(v: ClosedReason) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "AstalNotifdState")]
pub enum State {
    #[doc(alias = "ASTAL_NOTIFD_STATE_DRAFT")]
    Draft,
    #[doc(alias = "ASTAL_NOTIFD_STATE_SENT")]
    Sent,
    #[doc(alias = "ASTAL_NOTIFD_STATE_RECEIVED")]
    Received,
#[doc(hidden)]
    __Unknown(i32),
}

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

    #[inline]
fn into_glib(self) -> ffi::AstalNotifdState {
match self {
            Self::Draft => ffi::ASTAL_NOTIFD_STATE_DRAFT,
            Self::Sent => ffi::ASTAL_NOTIFD_STATE_SENT,
            Self::Received => ffi::ASTAL_NOTIFD_STATE_RECEIVED,
            Self::__Unknown(value) => value,
}
}
}

#[doc(hidden)]
impl FromGlib<ffi::AstalNotifdState> for State {
    #[inline]
unsafe fn from_glib(value: ffi::AstalNotifdState) -> Self {
        skip_assert_initialized!();
        
match value {
            ffi::ASTAL_NOTIFD_STATE_DRAFT => Self::Draft,
            ffi::ASTAL_NOTIFD_STATE_SENT => Self::Sent,
            ffi::ASTAL_NOTIFD_STATE_RECEIVED => Self::Received,
            value => Self::__Unknown(value),
}
}
}

impl StaticType for State {
                #[inline]
    #[doc(alias = "astal_notifd_state_get_type")]
   fn static_type() -> glib::Type {
                    unsafe { from_glib(ffi::astal_notifd_state_get_type()) }
                }
            }

impl glib::HasParamSpec for State {
                type ParamSpec = glib::ParamSpecEnum;
                type SetValue = Self;
                type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
    
                fn param_spec_builder() -> Self::BuilderFn {
                    Self::ParamSpec::builder_with_default
                }
}

impl glib::value::ValueType for State {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for State {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for State {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<State> for glib::Value {
    #[inline]
    fn from(v: State) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "AstalNotifdUrgency")]
pub enum Urgency {
    #[doc(alias = "ASTAL_NOTIFD_URGENCY_LOW")]
    Low,
    #[doc(alias = "ASTAL_NOTIFD_URGENCY_NORMAL")]
    Normal,
    #[doc(alias = "ASTAL_NOTIFD_URGENCY_CRITICAL")]
    Critical,
#[doc(hidden)]
    __Unknown(i32),
}

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

    #[inline]
fn into_glib(self) -> ffi::AstalNotifdUrgency {
match self {
            Self::Low => ffi::ASTAL_NOTIFD_URGENCY_LOW,
            Self::Normal => ffi::ASTAL_NOTIFD_URGENCY_NORMAL,
            Self::Critical => ffi::ASTAL_NOTIFD_URGENCY_CRITICAL,
            Self::__Unknown(value) => value,
}
}
}

#[doc(hidden)]
impl FromGlib<ffi::AstalNotifdUrgency> for Urgency {
    #[inline]
unsafe fn from_glib(value: ffi::AstalNotifdUrgency) -> Self {
        skip_assert_initialized!();
        
match value {
            ffi::ASTAL_NOTIFD_URGENCY_LOW => Self::Low,
            ffi::ASTAL_NOTIFD_URGENCY_NORMAL => Self::Normal,
            ffi::ASTAL_NOTIFD_URGENCY_CRITICAL => Self::Critical,
            value => Self::__Unknown(value),
}
}
}

impl StaticType for Urgency {
                #[inline]
    #[doc(alias = "astal_notifd_urgency_get_type")]
   fn static_type() -> glib::Type {
                    unsafe { from_glib(ffi::astal_notifd_urgency_get_type()) }
                }
            }

impl glib::HasParamSpec for Urgency {
                type ParamSpec = glib::ParamSpecEnum;
                type SetValue = Self;
                type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
    
                fn param_spec_builder() -> Self::BuilderFn {
                    Self::ParamSpec::builder_with_default
                }
}

impl glib::value::ValueType for Urgency {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for Urgency {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
    }
}

impl ToValue for Urgency {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<Urgency> for glib::Value {
    #[inline]
    fn from(v: Urgency) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

