1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
// 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::{prelude::*, translate::*};
use std::fmt;

glib::wrapper! {
    ///
    ///
    /// ## Properties
    ///
    ///
    /// #### `path`
    ///  Readable | Writeable | Construct Only
    ///
    ///
    /// #### `schema-id`
    ///  Readable | Writeable | Construct Only
    ///
    /// # Implements
    ///
    /// [`trait@glib::ObjectExt`]
    #[doc(alias = "DzlSettingsSandwich")]
    pub struct SettingsSandwich(Object<ffi::DzlSettingsSandwich, ffi::DzlSettingsSandwichClass>);

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

impl SettingsSandwich {
    #[doc(alias = "dzl_settings_sandwich_new")]
    pub fn new(schema_id: &str, path: &str) -> SettingsSandwich {
        assert_initialized_main_thread!();
        unsafe {
            from_glib_full(ffi::dzl_settings_sandwich_new(
                schema_id.to_glib_none().0,
                path.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "dzl_settings_sandwich_append")]
    pub fn append(&self, settings: &impl IsA<gio::Settings>) {
        unsafe {
            ffi::dzl_settings_sandwich_append(
                self.to_glib_none().0,
                settings.as_ref().to_glib_none().0,
            );
        }
    }

    //#[doc(alias = "dzl_settings_sandwich_bind")]
    //pub fn bind(&self, key: &str, object: /*Unimplemented*/Option<Basic: Pointer>, property: &str, flags: gio::SettingsBindFlags) {
    //    unsafe { TODO: call ffi:dzl_settings_sandwich_bind() }
    //}

    //#[doc(alias = "dzl_settings_sandwich_bind_with_mapping")]
    //pub fn bind_with_mapping<P: Fn(&glib::Value, &glib::Variant) -> bool + 'static, Q: Fn(&glib::Value, &glib::VariantType) -> glib::Variant + 'static>(&self, key: &str, object: /*Unimplemented*/Option<Basic: Pointer>, property: &str, flags: gio::SettingsBindFlags, get_mapping: P, set_mapping: Q) {
    //    unsafe { TODO: call ffi:dzl_settings_sandwich_bind_with_mapping() }
    //}

    #[doc(alias = "dzl_settings_sandwich_get_boolean")]
    #[doc(alias = "get_boolean")]
    pub fn is_boolean(&self, key: &str) -> bool {
        unsafe {
            from_glib(ffi::dzl_settings_sandwich_get_boolean(
                self.to_glib_none().0,
                key.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "dzl_settings_sandwich_get_default_value")]
    #[doc(alias = "get_default_value")]
    pub fn default_value(&self, key: &str) -> Option<glib::Variant> {
        unsafe {
            from_glib_full(ffi::dzl_settings_sandwich_get_default_value(
                self.to_glib_none().0,
                key.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "dzl_settings_sandwich_get_double")]
    #[doc(alias = "get_double")]
    pub fn double(&self, key: &str) -> f64 {
        unsafe {
            ffi::dzl_settings_sandwich_get_double(self.to_glib_none().0, key.to_glib_none().0)
        }
    }

    #[doc(alias = "dzl_settings_sandwich_get_int")]
    #[doc(alias = "get_int")]
    pub fn int(&self, key: &str) -> i32 {
        unsafe { ffi::dzl_settings_sandwich_get_int(self.to_glib_none().0, key.to_glib_none().0) }
    }

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

    #[doc(alias = "dzl_settings_sandwich_get_uint")]
    #[doc(alias = "get_uint")]
    pub fn uint(&self, key: &str) -> u32 {
        unsafe { ffi::dzl_settings_sandwich_get_uint(self.to_glib_none().0, key.to_glib_none().0) }
    }

    #[doc(alias = "dzl_settings_sandwich_get_user_value")]
    #[doc(alias = "get_user_value")]
    pub fn user_value(&self, key: &str) -> Option<glib::Variant> {
        unsafe {
            from_glib_full(ffi::dzl_settings_sandwich_get_user_value(
                self.to_glib_none().0,
                key.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "dzl_settings_sandwich_get_value")]
    #[doc(alias = "get_value")]
    pub fn value(&self, key: &str) -> Option<glib::Variant> {
        unsafe {
            from_glib_full(ffi::dzl_settings_sandwich_get_value(
                self.to_glib_none().0,
                key.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "dzl_settings_sandwich_set_boolean")]
    pub fn set_boolean(&self, key: &str, val: bool) {
        unsafe {
            ffi::dzl_settings_sandwich_set_boolean(
                self.to_glib_none().0,
                key.to_glib_none().0,
                val.into_glib(),
            );
        }
    }

    #[doc(alias = "dzl_settings_sandwich_set_double")]
    pub fn set_double(&self, key: &str, val: f64) {
        unsafe {
            ffi::dzl_settings_sandwich_set_double(self.to_glib_none().0, key.to_glib_none().0, val);
        }
    }

    #[doc(alias = "dzl_settings_sandwich_set_int")]
    pub fn set_int(&self, key: &str, val: i32) {
        unsafe {
            ffi::dzl_settings_sandwich_set_int(self.to_glib_none().0, key.to_glib_none().0, val);
        }
    }

    #[doc(alias = "dzl_settings_sandwich_set_string")]
    pub fn set_string(&self, key: &str, val: &str) {
        unsafe {
            ffi::dzl_settings_sandwich_set_string(
                self.to_glib_none().0,
                key.to_glib_none().0,
                val.to_glib_none().0,
            );
        }
    }

    #[doc(alias = "dzl_settings_sandwich_set_uint")]
    pub fn set_uint(&self, key: &str, val: u32) {
        unsafe {
            ffi::dzl_settings_sandwich_set_uint(self.to_glib_none().0, key.to_glib_none().0, val);
        }
    }

    #[doc(alias = "dzl_settings_sandwich_set_value")]
    pub fn set_value(&self, key: &str, value: &glib::Variant) {
        unsafe {
            ffi::dzl_settings_sandwich_set_value(
                self.to_glib_none().0,
                key.to_glib_none().0,
                value.to_glib_none().0,
            );
        }
    }

    #[doc(alias = "dzl_settings_sandwich_unbind")]
    pub fn unbind(&self, property: &str) {
        unsafe {
            ffi::dzl_settings_sandwich_unbind(self.to_glib_none().0, property.to_glib_none().0);
        }
    }

    pub fn path(&self) -> Option<glib::GString> {
        ObjectExt::property(self, "path")
    }

    #[doc(alias = "schema-id")]
    pub fn schema_id(&self) -> Option<glib::GString> {
        ObjectExt::property(self, "schema-id")
    }
}

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