// This file was generated by gir (6231689) from gir-files (0bcaef9)
// DO NOT EDIT

use ParamFlags;
use ffi;
use glib;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::mem;
use std::ptr;

glib_wrapper! {
    pub struct ParamSpec(Object<ffi::GParamSpec>);

    match fn {
        get_type => || ffi::intern(),
    }
}

impl ParamSpec {
    pub fn internal(param_type: glib::types::Type, name: &str, nick: &str, blurb: &str, flags: ParamFlags) -> Option<ParamSpec> {
        unsafe {
            from_glib_none(ffi::g_param_spec_internal(param_type.to_glib(), name.to_glib_none().0, nick.to_glib_none().0, blurb.to_glib_none().0, flags.to_glib()))
        }
    }
}

pub trait ParamSpecExt {
    fn get_blurb(&self) -> Option<String>;

    //#[cfg(any(feature = "v2_38", feature = "dox"))]
    //fn get_default_value(&self) -> /*Ignored*/Option<Value>;

    fn get_name(&self) -> Option<String>;

    //#[cfg(any(feature = "v2_46", feature = "dox"))]
    //fn get_name_quark(&self) -> /*Ignored*/glib::Quark;

    fn get_nick(&self) -> Option<String>;

    //fn get_qdata(&self, quark: /*Ignored*/glib::Quark) -> /*Unimplemented*/Option<Fundamental: Pointer>;

    fn get_redirect_target(&self) -> Option<ParamSpec>;

    fn ref_sink(&self) -> Option<ParamSpec>;

    //fn set_qdata<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, quark: /*Ignored*/glib::Quark, data: P);

    //fn set_qdata_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, quark: /*Ignored*/glib::Quark, data: P, destroy: /*Unknown conversion*//*Unimplemented*/DestroyNotify);

    fn sink(&self);

    //fn steal_qdata(&self, quark: /*Ignored*/glib::Quark) -> /*Unimplemented*/Option<Fundamental: Pointer>;
}

impl<O: IsA<ParamSpec>> ParamSpecExt for O {
    fn get_blurb(&self) -> Option<String> {
        unsafe {
            from_glib_none(ffi::g_param_spec_get_blurb(self.to_glib_none().0))
        }
    }

    //#[cfg(any(feature = "v2_38", feature = "dox"))]
    //fn get_default_value(&self) -> /*Ignored*/Option<Value> {
    //    unsafe { TODO: call ffi::g_param_spec_get_default_value() }
    //}

    fn get_name(&self) -> Option<String> {
        unsafe {
            from_glib_none(ffi::g_param_spec_get_name(self.to_glib_none().0))
        }
    }

    //#[cfg(any(feature = "v2_46", feature = "dox"))]
    //fn get_name_quark(&self) -> /*Ignored*/glib::Quark {
    //    unsafe { TODO: call ffi::g_param_spec_get_name_quark() }
    //}

    fn get_nick(&self) -> Option<String> {
        unsafe {
            from_glib_none(ffi::g_param_spec_get_nick(self.to_glib_none().0))
        }
    }

    //fn get_qdata(&self, quark: /*Ignored*/glib::Quark) -> /*Unimplemented*/Option<Fundamental: Pointer> {
    //    unsafe { TODO: call ffi::g_param_spec_get_qdata() }
    //}

    fn get_redirect_target(&self) -> Option<ParamSpec> {
        unsafe {
            from_glib_none(ffi::g_param_spec_get_redirect_target(self.to_glib_none().0))
        }
    }

    fn ref_sink(&self) -> Option<ParamSpec> {
        unsafe {
            from_glib_none(ffi::g_param_spec_ref_sink(self.to_glib_none().0))
        }
    }

    //fn set_qdata<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, quark: /*Ignored*/glib::Quark, data: P) {
    //    unsafe { TODO: call ffi::g_param_spec_set_qdata() }
    //}

    //fn set_qdata_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, quark: /*Ignored*/glib::Quark, data: P, destroy: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
    //    unsafe { TODO: call ffi::g_param_spec_set_qdata_full() }
    //}

    fn sink(&self) {
        unsafe {
            ffi::g_param_spec_sink(self.to_glib_none().0);
        }
    }

    //fn steal_qdata(&self, quark: /*Ignored*/glib::Quark) -> /*Unimplemented*/Option<Fundamental: Pointer> {
    //    unsafe { TODO: call ffi::g_param_spec_steal_qdata() }
    //}
}
