glibmm 2.80.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Symbols | List of all members
Gio::SettingsSchema Class Referencefinal

Introspecting and controlling the loading of GSettings schemas. More...

#include <giomm/settingsschema.h>

Public Member Functions

void reference () const
 Increment the reference count for this object.
 
void unreference () const
 Decrement the reference count for this object.
 
GSettingsSchemagobj ()
 Provides access to the underlying C instance.
 
const GSettingsSchemagobj () const
 Provides access to the underlying C instance.
 
GSettingsSchemagobj_copy () const
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
 
 SettingsSchema ()=delete
 
 SettingsSchema (const SettingsSchema &)=delete
 
SettingsSchemaoperator= (const SettingsSchema &)=delete
 
Glib::ustring get_id () const
 Get the ID of schema.
 
Glib::ustring get_path () const
 Gets the path associated with schema, or nullptr.
 
Glib::RefPtr< SettingsSchemaKeyget_key (const Glib::ustring & name)
 Gets the key named name from schema.
 
Glib::RefPtr< const SettingsSchemaKeyget_key (const Glib::ustring & name) const
 Gets the key named name from schema.
 
bool has_key (const Glib::ustring & name) const
 Checks if schema has a key named name.
 
std::vector< Glib::ustringlist_keys () const
 Introspects the list of keys on schema.
 
std::vector< Glib::ustringlist_children () const
 Gets the list of children in schema.
 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system.
 

Protected Member Functions

void operator delete (void *, std::size_t)
 

Related Symbols

(Note that these are not member symbols.)

Glib::RefPtr< Gio::SettingsSchemawrap (GSettingsSchema *object, bool take_copy=false)
 A Glib::wrap() method for this object.
 

Detailed Description

Introspecting and controlling the loading of GSettings schemas.

The SettingsSchemaSource and SettingsSchema APIs provide a mechanism for advanced control over the loading of schemas and a mechanism for introspecting their content.

Plugin loading systems that wish to provide plugins a way to access settings face the problem of how to make the schemas for these settings visible to GSettings. Typically, a plugin will want to ship the schema along with itself and it won't be installed into the standard system directories for schemas.

SettingsSchemaSource provides a mechanism for dealing with this by allowing the creation of a new 'schema source' from which schemas can be acquired. This schema source can then become part of the metadata associated with the plugin and queried whenever the plugin requires access to some settings.

Since glibmm 2.32:

Constructor & Destructor Documentation

◆ SettingsSchema() [1/2]

Gio::SettingsSchema::SettingsSchema ( )
delete

◆ SettingsSchema() [2/2]

Gio::SettingsSchema::SettingsSchema ( const SettingsSchema )
delete

Member Function Documentation

◆ get_id()

Glib::ustring Gio::SettingsSchema::get_id ( ) const

Get the ID of schema.

Returns
The ID.

◆ get_key() [1/2]

Glib::RefPtr< SettingsSchemaKey > Gio::SettingsSchema::get_key ( const Glib::ustring name)

Gets the key named name from schema.

It is a programmer error to request a key that does not exist. See g_settings_schema_list_keys().

Since glibmm 2.40:
Parameters
nameThe name of a key.
Returns
The SettingsSchemaKey for name.

◆ get_key() [2/2]

Glib::RefPtr< const SettingsSchemaKey > Gio::SettingsSchema::get_key ( const Glib::ustring name) const

Gets the key named name from schema.

It is a programmer error to request a key that does not exist. See g_settings_schema_list_keys().

Since glibmm 2.40:
Parameters
nameThe name of a key.
Returns
The SettingsSchemaKey for name.

◆ get_path()

Glib::ustring Gio::SettingsSchema::get_path ( ) const

Gets the path associated with schema, or nullptr.

Schemas may be single-instance or relocatable. Single-instance schemas correspond to exactly one set of keys in the backend database: those located at the path returned by this function.

Relocatable schemas can be referenced by other schemas and can therefore describe multiple sets of keys at different locations. For relocatable schemas, this function will return nullptr.

Since glibmm 2.32:
Returns
The path of the schema, or nullptr.

◆ get_type()

static GType Gio::SettingsSchema::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

◆ gobj() [1/2]

GSettingsSchema * Gio::SettingsSchema::gobj ( )

Provides access to the underlying C instance.

◆ gobj() [2/2]

const GSettingsSchema * Gio::SettingsSchema::gobj ( ) const

Provides access to the underlying C instance.

◆ gobj_copy()

GSettingsSchema * Gio::SettingsSchema::gobj_copy ( ) const

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

◆ has_key()

bool Gio::SettingsSchema::has_key ( const Glib::ustring name) const

Checks if schema has a key named name.

Since glibmm 2.40:
Parameters
nameThe name of a key.
Returns
true if such a key exists.

◆ list_children()

std::vector< Glib::ustring > Gio::SettingsSchema::list_children ( ) const

Gets the list of children in schema.

Since glibmm 2.44:
Returns
A list of the children on settings, in no defined order.

◆ list_keys()

std::vector< Glib::ustring > Gio::SettingsSchema::list_keys ( ) const

Introspects the list of keys on schema.

You should probably not be calling this function from "normal" code (since you should already know what keys are in your schema). This function is intended for introspection reasons.

Since glibmm 2.46:
Returns
A list of the keys on schema, in no defined order.

◆ operator delete()

void Gio::SettingsSchema::operator delete ( void ,
std::size_t   
)
protected

◆ operator=()

SettingsSchema & Gio::SettingsSchema::operator= ( const SettingsSchema )
delete

◆ reference()

void Gio::SettingsSchema::reference ( ) const

Increment the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

◆ unreference()

void Gio::SettingsSchema::unreference ( ) const

Decrement the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

Friends And Related Symbol Documentation

◆ wrap()

Glib::RefPtr< Gio::SettingsSchema > wrap ( GSettingsSchema object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.