gio/auto/
settings_schema_key.rs1use gio_sys;
6use glib;
7use glib::translate::*;
8use glib::GString;
9
10glib_wrapper! {
11 #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
12 pub struct SettingsSchemaKey(Shared<gio_sys::GSettingsSchemaKey>);
13
14 match fn {
15 ref => |ptr| gio_sys::g_settings_schema_key_ref(ptr),
16 unref => |ptr| gio_sys::g_settings_schema_key_unref(ptr),
17 get_type => || gio_sys::g_settings_schema_key_get_type(),
18 }
19}
20
21impl SettingsSchemaKey {
22 pub fn get_default_value(&self) -> Option<glib::Variant> {
23 unsafe {
24 from_glib_full(gio_sys::g_settings_schema_key_get_default_value(
25 self.to_glib_none().0,
26 ))
27 }
28 }
29
30 pub fn get_description(&self) -> Option<GString> {
31 unsafe {
32 from_glib_none(gio_sys::g_settings_schema_key_get_description(
33 self.to_glib_none().0,
34 ))
35 }
36 }
37
38 #[cfg(any(feature = "v2_44", feature = "dox"))]
39 pub fn get_name(&self) -> Option<GString> {
40 unsafe {
41 from_glib_none(gio_sys::g_settings_schema_key_get_name(
42 self.to_glib_none().0,
43 ))
44 }
45 }
46
47 pub fn get_range(&self) -> Option<glib::Variant> {
48 unsafe {
49 from_glib_full(gio_sys::g_settings_schema_key_get_range(
50 self.to_glib_none().0,
51 ))
52 }
53 }
54
55 pub fn get_summary(&self) -> Option<GString> {
56 unsafe {
57 from_glib_none(gio_sys::g_settings_schema_key_get_summary(
58 self.to_glib_none().0,
59 ))
60 }
61 }
62
63 pub fn get_value_type(&self) -> Option<glib::VariantType> {
64 unsafe {
65 from_glib_none(gio_sys::g_settings_schema_key_get_value_type(
66 self.to_glib_none().0,
67 ))
68 }
69 }
70
71 pub fn range_check(&self, value: &glib::Variant) -> bool {
72 unsafe {
73 from_glib(gio_sys::g_settings_schema_key_range_check(
74 self.to_glib_none().0,
75 value.to_glib_none().0,
76 ))
77 }
78 }
79}