// 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 glib::translate::*;
use std::fmt;

glib::wrapper! {
    #[doc(alias = "HdyValueObject")]
    pub struct ValueObject(Object<ffi::HdyValueObject, ffi::HdyValueObjectClass>);

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

impl ValueObject {
    #[doc(alias = "hdy_value_object_new")]
    pub fn new(value: &glib::Value) -> ValueObject {
        assert_initialized_main_thread!();
        unsafe { from_glib_full(ffi::hdy_value_object_new(value.to_glib_none().0)) }
    }

    //#[doc(alias = "hdy_value_object_new_collect")]
    //pub fn new_collect(type_: glib::types::Type, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) -> ValueObject {
    //    unsafe { TODO: call ffi:hdy_value_object_new_collect() }
    //}

    #[doc(alias = "hdy_value_object_get_string")]
    #[doc(alias = "get_string")]
    pub fn string(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::hdy_value_object_get_string(self.to_glib_none().0)) }
    }

    #[doc(alias = "hdy_value_object_get_value")]
    #[doc(alias = "get_value")]
    pub fn value(&self) -> Option<glib::Value> {
        unsafe { from_glib_none(ffi::hdy_value_object_get_value(self.to_glib_none().0)) }
    }
}

impl fmt::Display for ValueObject {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str("ValueObject")
    }
}
