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

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

bitflags! {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "GWeatherFormatOptions")]
    pub struct FormatOptions: u32 {
        #[doc(alias = "GWEATHER_FORMAT_OPTION_DEFAULT")]
        const DEFAULT = ffi::GWEATHER_FORMAT_OPTION_DEFAULT as _;
        #[doc(alias = "GWEATHER_FORMAT_OPTION_SENTENCE_CAPITALIZATION")]
        const SENTENCE_CAPITALIZATION = ffi::GWEATHER_FORMAT_OPTION_SENTENCE_CAPITALIZATION as _;
        #[doc(alias = "GWEATHER_FORMAT_OPTION_NO_CAPITALIZATION")]
        const NO_CAPITALIZATION = ffi::GWEATHER_FORMAT_OPTION_NO_CAPITALIZATION as _;
    }
}

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

    #[inline]
    fn into_glib(self) -> ffi::GWeatherFormatOptions {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GWeatherFormatOptions> for FormatOptions {
    #[inline]
    unsafe fn from_glib(value: ffi::GWeatherFormatOptions) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

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

impl glib::HasParamSpec for FormatOptions {
                type ParamSpec = glib::ParamSpecFlags;
                type SetValue = Self;
                type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
    
                fn param_spec_builder() -> Self::BuilderFn {
                    Self::ParamSpec::builder
                }
}

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

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

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

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

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

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

bitflags! {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "GWeatherProvider")]
    pub struct Provider: u32 {
        #[doc(alias = "GWEATHER_PROVIDER_NONE")]
        const NONE = ffi::GWEATHER_PROVIDER_NONE as _;
        #[doc(alias = "GWEATHER_PROVIDER_METAR")]
        const METAR = ffi::GWEATHER_PROVIDER_METAR as _;
        #[doc(alias = "GWEATHER_PROVIDER_IWIN")]
        const IWIN = ffi::GWEATHER_PROVIDER_IWIN as _;
        #[doc(alias = "GWEATHER_PROVIDER_MET_NO")]
        const MET_NO = ffi::GWEATHER_PROVIDER_MET_NO as _;
        #[doc(alias = "GWEATHER_PROVIDER_OWM")]
        const OWM = ffi::GWEATHER_PROVIDER_OWM as _;
        #[doc(alias = "GWEATHER_PROVIDER_NWS")]
        const NWS = ffi::GWEATHER_PROVIDER_NWS as _;
        #[doc(alias = "GWEATHER_PROVIDER_ALL")]
        const ALL = ffi::GWEATHER_PROVIDER_ALL as _;
    }
}

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

    #[inline]
    fn into_glib(self) -> ffi::GWeatherProvider {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::GWeatherProvider> for Provider {
    #[inline]
    unsafe fn from_glib(value: ffi::GWeatherProvider) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

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

impl glib::HasParamSpec for Provider {
                type ParamSpec = glib::ParamSpecFlags;
                type SetValue = Self;
                type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
    
                fn param_spec_builder() -> Self::BuilderFn {
                    Self::ParamSpec::builder
                }
}

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

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

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

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

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

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

