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

use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use handy_sys;
use std::fmt;

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum CenteringPolicy {
    Loose,
    Strict,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for CenteringPolicy {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "CenteringPolicy::{}",
            match *self {
                CenteringPolicy::Loose => "Loose",
                CenteringPolicy::Strict => "Strict",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for CenteringPolicy {
    type GlibType = handy_sys::HdyCenteringPolicy;

    fn to_glib(&self) -> handy_sys::HdyCenteringPolicy {
        match *self {
            CenteringPolicy::Loose => handy_sys::HDY_CENTERING_POLICY_LOOSE,
            CenteringPolicy::Strict => handy_sys::HDY_CENTERING_POLICY_STRICT,
            CenteringPolicy::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<handy_sys::HdyCenteringPolicy> for CenteringPolicy {
    fn from_glib(value: handy_sys::HdyCenteringPolicy) -> Self {
        skip_assert_initialized!();
        match value {
            0 => CenteringPolicy::Loose,
            1 => CenteringPolicy::Strict,
            value => CenteringPolicy::__Unknown(value),
        }
    }
}

impl StaticType for CenteringPolicy {
    fn static_type() -> Type {
        unsafe { from_glib(handy_sys::hdy_centering_policy_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for CenteringPolicy {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for CenteringPolicy {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for CenteringPolicy {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum DeckTransitionType {
    Over,
    Under,
    Slide,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for DeckTransitionType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "DeckTransitionType::{}",
            match *self {
                DeckTransitionType::Over => "Over",
                DeckTransitionType::Under => "Under",
                DeckTransitionType::Slide => "Slide",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for DeckTransitionType {
    type GlibType = handy_sys::HdyDeckTransitionType;

    fn to_glib(&self) -> handy_sys::HdyDeckTransitionType {
        match *self {
            DeckTransitionType::Over => handy_sys::HDY_DECK_TRANSITION_TYPE_OVER,
            DeckTransitionType::Under => handy_sys::HDY_DECK_TRANSITION_TYPE_UNDER,
            DeckTransitionType::Slide => handy_sys::HDY_DECK_TRANSITION_TYPE_SLIDE,
            DeckTransitionType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<handy_sys::HdyDeckTransitionType> for DeckTransitionType {
    fn from_glib(value: handy_sys::HdyDeckTransitionType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => DeckTransitionType::Over,
            1 => DeckTransitionType::Under,
            2 => DeckTransitionType::Slide,
            value => DeckTransitionType::__Unknown(value),
        }
    }
}

impl StaticType for DeckTransitionType {
    fn static_type() -> Type {
        unsafe { from_glib(handy_sys::hdy_deck_transition_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for DeckTransitionType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for DeckTransitionType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for DeckTransitionType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum HeaderGroupChildType {
    HeaderBar,
    GtkHeaderBar,
    HeaderGroup,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for HeaderGroupChildType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "HeaderGroupChildType::{}",
            match *self {
                HeaderGroupChildType::HeaderBar => "HeaderBar",
                HeaderGroupChildType::GtkHeaderBar => "GtkHeaderBar",
                HeaderGroupChildType::HeaderGroup => "HeaderGroup",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for HeaderGroupChildType {
    type GlibType = handy_sys::HdyHeaderGroupChildType;

    fn to_glib(&self) -> handy_sys::HdyHeaderGroupChildType {
        match *self {
            HeaderGroupChildType::HeaderBar => handy_sys::HDY_HEADER_GROUP_CHILD_TYPE_HEADER_BAR,
            HeaderGroupChildType::GtkHeaderBar => {
                handy_sys::HDY_HEADER_GROUP_CHILD_TYPE_GTK_HEADER_BAR
            }
            HeaderGroupChildType::HeaderGroup => {
                handy_sys::HDY_HEADER_GROUP_CHILD_TYPE_HEADER_GROUP
            }
            HeaderGroupChildType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<handy_sys::HdyHeaderGroupChildType> for HeaderGroupChildType {
    fn from_glib(value: handy_sys::HdyHeaderGroupChildType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => HeaderGroupChildType::HeaderBar,
            1 => HeaderGroupChildType::GtkHeaderBar,
            2 => HeaderGroupChildType::HeaderGroup,
            value => HeaderGroupChildType::__Unknown(value),
        }
    }
}

impl StaticType for HeaderGroupChildType {
    fn static_type() -> Type {
        unsafe { from_glib(handy_sys::hdy_header_group_child_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for HeaderGroupChildType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for HeaderGroupChildType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for HeaderGroupChildType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum LeafletTransitionType {
    Over,
    Under,
    Slide,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for LeafletTransitionType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "LeafletTransitionType::{}",
            match *self {
                LeafletTransitionType::Over => "Over",
                LeafletTransitionType::Under => "Under",
                LeafletTransitionType::Slide => "Slide",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for LeafletTransitionType {
    type GlibType = handy_sys::HdyLeafletTransitionType;

    fn to_glib(&self) -> handy_sys::HdyLeafletTransitionType {
        match *self {
            LeafletTransitionType::Over => handy_sys::HDY_LEAFLET_TRANSITION_TYPE_OVER,
            LeafletTransitionType::Under => handy_sys::HDY_LEAFLET_TRANSITION_TYPE_UNDER,
            LeafletTransitionType::Slide => handy_sys::HDY_LEAFLET_TRANSITION_TYPE_SLIDE,
            LeafletTransitionType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<handy_sys::HdyLeafletTransitionType> for LeafletTransitionType {
    fn from_glib(value: handy_sys::HdyLeafletTransitionType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => LeafletTransitionType::Over,
            1 => LeafletTransitionType::Under,
            2 => LeafletTransitionType::Slide,
            value => LeafletTransitionType::__Unknown(value),
        }
    }
}

impl StaticType for LeafletTransitionType {
    fn static_type() -> Type {
        unsafe { from_glib(handy_sys::hdy_leaflet_transition_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for LeafletTransitionType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for LeafletTransitionType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for LeafletTransitionType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum NavigationDirection {
    Back,
    Forward,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for NavigationDirection {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "NavigationDirection::{}",
            match *self {
                NavigationDirection::Back => "Back",
                NavigationDirection::Forward => "Forward",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for NavigationDirection {
    type GlibType = handy_sys::HdyNavigationDirection;

    fn to_glib(&self) -> handy_sys::HdyNavigationDirection {
        match *self {
            NavigationDirection::Back => handy_sys::HDY_NAVIGATION_DIRECTION_BACK,
            NavigationDirection::Forward => handy_sys::HDY_NAVIGATION_DIRECTION_FORWARD,
            NavigationDirection::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<handy_sys::HdyNavigationDirection> for NavigationDirection {
    fn from_glib(value: handy_sys::HdyNavigationDirection) -> Self {
        skip_assert_initialized!();
        match value {
            0 => NavigationDirection::Back,
            1 => NavigationDirection::Forward,
            value => NavigationDirection::__Unknown(value),
        }
    }
}

impl StaticType for NavigationDirection {
    fn static_type() -> Type {
        unsafe { from_glib(handy_sys::hdy_navigation_direction_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for NavigationDirection {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for NavigationDirection {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for NavigationDirection {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum SqueezerTransitionType {
    None,
    Crossfade,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for SqueezerTransitionType {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "SqueezerTransitionType::{}",
            match *self {
                SqueezerTransitionType::None => "None",
                SqueezerTransitionType::Crossfade => "Crossfade",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for SqueezerTransitionType {
    type GlibType = handy_sys::HdySqueezerTransitionType;

    fn to_glib(&self) -> handy_sys::HdySqueezerTransitionType {
        match *self {
            SqueezerTransitionType::None => handy_sys::HDY_SQUEEZER_TRANSITION_TYPE_NONE,
            SqueezerTransitionType::Crossfade => handy_sys::HDY_SQUEEZER_TRANSITION_TYPE_CROSSFADE,
            SqueezerTransitionType::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<handy_sys::HdySqueezerTransitionType> for SqueezerTransitionType {
    fn from_glib(value: handy_sys::HdySqueezerTransitionType) -> Self {
        skip_assert_initialized!();
        match value {
            0 => SqueezerTransitionType::None,
            1 => SqueezerTransitionType::Crossfade,
            value => SqueezerTransitionType::__Unknown(value),
        }
    }
}

impl StaticType for SqueezerTransitionType {
    fn static_type() -> Type {
        unsafe { from_glib(handy_sys::hdy_squeezer_transition_type_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for SqueezerTransitionType {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for SqueezerTransitionType {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for SqueezerTransitionType {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}

#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum ViewSwitcherPolicy {
    Auto,
    Narrow,
    Wide,
    #[doc(hidden)]
    __Unknown(i32),
}

impl fmt::Display for ViewSwitcherPolicy {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "ViewSwitcherPolicy::{}",
            match *self {
                ViewSwitcherPolicy::Auto => "Auto",
                ViewSwitcherPolicy::Narrow => "Narrow",
                ViewSwitcherPolicy::Wide => "Wide",
                _ => "Unknown",
            }
        )
    }
}

#[doc(hidden)]
impl ToGlib for ViewSwitcherPolicy {
    type GlibType = handy_sys::HdyViewSwitcherPolicy;

    fn to_glib(&self) -> handy_sys::HdyViewSwitcherPolicy {
        match *self {
            ViewSwitcherPolicy::Auto => handy_sys::HDY_VIEW_SWITCHER_POLICY_AUTO,
            ViewSwitcherPolicy::Narrow => handy_sys::HDY_VIEW_SWITCHER_POLICY_NARROW,
            ViewSwitcherPolicy::Wide => handy_sys::HDY_VIEW_SWITCHER_POLICY_WIDE,
            ViewSwitcherPolicy::__Unknown(value) => value,
        }
    }
}

#[doc(hidden)]
impl FromGlib<handy_sys::HdyViewSwitcherPolicy> for ViewSwitcherPolicy {
    fn from_glib(value: handy_sys::HdyViewSwitcherPolicy) -> Self {
        skip_assert_initialized!();
        match value {
            0 => ViewSwitcherPolicy::Auto,
            1 => ViewSwitcherPolicy::Narrow,
            2 => ViewSwitcherPolicy::Wide,
            value => ViewSwitcherPolicy::__Unknown(value),
        }
    }
}

impl StaticType for ViewSwitcherPolicy {
    fn static_type() -> Type {
        unsafe { from_glib(handy_sys::hdy_view_switcher_policy_get_type()) }
    }
}

impl<'a> FromValueOptional<'a> for ViewSwitcherPolicy {
    unsafe fn from_value_optional(value: &Value) -> Option<Self> {
        Some(FromValue::from_value(value))
    }
}

impl<'a> FromValue<'a> for ViewSwitcherPolicy {
    unsafe fn from_value(value: &Value) -> Self {
        from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
    }
}

impl SetValue for ViewSwitcherPolicy {
    unsafe fn set_value(value: &mut Value, this: &Self) {
        gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
    }
}
