Class
GioSettingsBackend
Description
abstract class Gio.SettingsBackend : GObject.Object
{
/* No available fields */
}
The GSettingsBackend
interface defines a generic interface for
non-strictly-typed data that is stored in a hierarchy. To implement
an alternative storage backend for GSettings
, you need to implement
the GSettingsBackend
interface and then make it implement the
extension point G_SETTINGS_BACKEND_EXTENSION_POINT_NAME
.
The interface defines methods for reading and writing values, a method for determining if writing of certain values will fail (lockdown) and a change notification mechanism.
The semantics of the interface are very precisely defined and implementations must carefully adhere to the expectations of callers that are documented on each of the interface methods.
Some of the GSettingsBackend
functions accept or return a GTree
.
These trees always have strings as keys and GVariant
as values.
g_settings_backend_create_tree()
is a convenience function to create
suitable trees.
The GSettingsBackend
API is exported to allow third-party
implementations, but does not carry the same stability guarantees
as the public GIO API. For this reason, you have to define the
C preprocessor symbol G_SETTINGS_ENABLE_BACKEND
before including
gio/gsettingsbackend.h
.
Functions
g_settings_backend_flatten_tree
Calculate the longest common prefix of all keys in a tree and write out an array of the key names relative to that prefix and, optionally, the value to store at each of those keys.
since: 2.26
g_settings_backend_get_default
Returns the default GSettingsBackend
. It is possible to override
the default by setting the GSETTINGS_BACKEND
environment variable
to the name of a settings backend.
since: 2.28
Instance methods
g_settings_backend_changed
Signals that a single key has possibly changed. Backend implementations should call this if a key has possibly changed its value.
since: 2.26
g_settings_backend_changed_tree
This call is a convenience wrapper. It gets the list of changes from
tree
, computes the longest common prefix and calls g_settings_backend_changed().
since: 2.26
g_settings_backend_keys_changed
Signals that a list of keys have possibly changed. Backend implementations should call this if keys have possibly changed their values.
since: 2.26
g_settings_backend_path_changed
Signals that all keys below a given path may have possibly changed. Backend implementations should call this if an entire path of keys have possibly changed their values.
since: 2.26
g_settings_backend_path_writable_changed
Signals that the writability of all keys below a given path may have changed.
since: 2.26
g_settings_backend_writable_changed
Signals that the writability of a single key has possibly changed.
since: 2.26
Signals
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.
Class structure
struct GioSettingsBackendClass {
GObjectClass parent_class;
GVariant* (* read) (
GSettingsBackend* backend,
const gchar* key,
const GVariantType* expected_type,
gboolean default_value
);
gboolean (* get_writable) (
GSettingsBackend* backend,
const gchar* key
);
gboolean (* write) (
GSettingsBackend* backend,
const gchar* key,
GVariant* value,
gpointer origin_tag
);
gboolean (* write_tree) (
GSettingsBackend* backend,
GTree* tree,
gpointer origin_tag
);
void (* reset) (
GSettingsBackend* backend,
const gchar* key,
gpointer origin_tag
);
void (* subscribe) (
GSettingsBackend* backend,
const gchar* name
);
void (* unsubscribe) (
GSettingsBackend* backend,
const gchar* name
);
void (* sync) (
GSettingsBackend* backend
);
GPermission* (* get_permission) (
GSettingsBackend* backend,
const gchar* path
);
GVariant* (* read_user_value) (
GSettingsBackend* backend,
const gchar* key,
const GVariantType* expected_type
);
}
Class structure for GSettingsBackend
.
Class members
parent_class: GObjectClass
- No description available.
read: GVariant* (* read) ( GSettingsBackend* backend, const gchar* key, const GVariantType* expected_type, gboolean default_value )
- No description available.
get_writable: gboolean (* get_writable) ( GSettingsBackend* backend, const gchar* key )
- No description available.
write: gboolean (* write) ( GSettingsBackend* backend, const gchar* key, GVariant* value, gpointer origin_tag )
- No description available.
write_tree: gboolean (* write_tree) ( GSettingsBackend* backend, GTree* tree, gpointer origin_tag )
- No description available.
reset: void (* reset) ( GSettingsBackend* backend, const gchar* key, gpointer origin_tag )
- No description available.
subscribe: void (* subscribe) ( GSettingsBackend* backend, const gchar* name )
- No description available.
unsubscribe: void (* unsubscribe) ( GSettingsBackend* backend, const gchar* name )
- No description available.
sync: void (* sync) ( GSettingsBackend* backend )
- No description available.
get_permission: GPermission* (* get_permission) ( GSettingsBackend* backend, const gchar* path )
- No description available.
read_user_value: GVariant* (* read_user_value) ( GSettingsBackend* backend, const gchar* key, const GVariantType* expected_type )
- No description available.