1 // This file was generated by gir (https://github.com/gtk-rs/gir) 2 // from gir-files (https://github.com/gtk-rs/gir-files) 3 // DO NOT EDIT 4 5 use crate::SettingsSchemaKey; 6 use glib::translate::*; 7 8 glib::wrapper! { 9 #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] 10 pub struct SettingsSchema(Shared<ffi::GSettingsSchema>); 11 12 match fn { 13 ref => |ptr| ffi::g_settings_schema_ref(ptr), 14 unref => |ptr| ffi::g_settings_schema_unref(ptr), 15 type_ => || ffi::g_settings_schema_get_type(), 16 } 17 } 18 19 impl SettingsSchema { 20 #[doc(alias = "g_settings_schema_get_id")] 21 #[doc(alias = "get_id")] id(&self) -> glib::GString22 pub fn id(&self) -> glib::GString { 23 unsafe { from_glib_none(ffi::g_settings_schema_get_id(self.to_glib_none().0)) } 24 } 25 26 #[doc(alias = "g_settings_schema_get_key")] 27 #[doc(alias = "get_key")] key(&self, name: &str) -> SettingsSchemaKey28 pub fn key(&self, name: &str) -> SettingsSchemaKey { 29 unsafe { 30 from_glib_full(ffi::g_settings_schema_get_key( 31 self.to_glib_none().0, 32 name.to_glib_none().0, 33 )) 34 } 35 } 36 37 #[doc(alias = "g_settings_schema_get_path")] 38 #[doc(alias = "get_path")] path(&self) -> Option<glib::GString>39 pub fn path(&self) -> Option<glib::GString> { 40 unsafe { from_glib_none(ffi::g_settings_schema_get_path(self.to_glib_none().0)) } 41 } 42 43 #[doc(alias = "g_settings_schema_has_key")] has_key(&self, name: &str) -> bool44 pub fn has_key(&self, name: &str) -> bool { 45 unsafe { 46 from_glib(ffi::g_settings_schema_has_key( 47 self.to_glib_none().0, 48 name.to_glib_none().0, 49 )) 50 } 51 } 52 53 #[doc(alias = "g_settings_schema_list_children")] list_children(&self) -> Vec<glib::GString>54 pub fn list_children(&self) -> Vec<glib::GString> { 55 unsafe { 56 FromGlibPtrContainer::from_glib_full(ffi::g_settings_schema_list_children( 57 self.to_glib_none().0, 58 )) 59 } 60 } 61 62 #[doc(alias = "g_settings_schema_list_keys")] list_keys(&self) -> Vec<glib::GString>63 pub fn list_keys(&self) -> Vec<glib::GString> { 64 unsafe { 65 FromGlibPtrContainer::from_glib_full(ffi::g_settings_schema_list_keys( 66 self.to_glib_none().0, 67 )) 68 } 69 } 70 } 71