// 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 ffi;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::mem;
use std::ptr;

glib_wrapper! {
    pub struct SettingsBackend(Object<ffi::GSettingsBackend, ffi::GSettingsBackendClass>);

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

impl SettingsBackend {
    //pub fn flatten_tree(tree: /*Ignored*/&glib::Tree) -> (String, Vec<String>, Vec<glib::Variant>) {
    //    unsafe { TODO: call ffi::g_settings_backend_flatten_tree() }
    //}

    pub fn get_default() -> Option<SettingsBackend> {
        unsafe {
            from_glib_full(ffi::g_settings_backend_get_default())
        }
    }
}

pub trait SettingsBackendExt {
    //fn changed<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, key: &str, origin_tag: P);

    //fn changed_tree<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, tree: /*Ignored*/&glib::Tree, origin_tag: P);

    //fn keys_changed<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, path: &str, items: &[&str], origin_tag: P);

    //fn path_changed<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, path: &str, origin_tag: P);

    fn path_writable_changed(&self, path: &str);

    fn writable_changed(&self, key: &str);
}

impl<O: IsA<SettingsBackend>> SettingsBackendExt for O {
    //fn changed<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, key: &str, origin_tag: P) {
    //    unsafe { TODO: call ffi::g_settings_backend_changed() }
    //}

    //fn changed_tree<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, tree: /*Ignored*/&glib::Tree, origin_tag: P) {
    //    unsafe { TODO: call ffi::g_settings_backend_changed_tree() }
    //}

    //fn keys_changed<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, path: &str, items: &[&str], origin_tag: P) {
    //    unsafe { TODO: call ffi::g_settings_backend_keys_changed() }
    //}

    //fn path_changed<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, path: &str, origin_tag: P) {
    //    unsafe { TODO: call ffi::g_settings_backend_path_changed() }
    //}

    fn path_writable_changed(&self, path: &str) {
        unsafe {
            ffi::g_settings_backend_path_writable_changed(self.to_glib_none().0, path.to_glib_none().0);
        }
    }

    fn writable_changed(&self, key: &str) {
        unsafe {
            ffi::g_settings_backend_writable_changed(self.to_glib_none().0, key.to_glib_none().0);
        }
    }
}
