![]() |
![]() |
![]() |
dconf Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
typedef DConfClientClass; DConfClient; void (*DConfWatchFunc) (DConfClient *client
,const gchar *tag
,const gchar *path
,const gchar * const *items
,gpointer user_data
); DConfClient * dconf_client_new (const gchar *context
,gboolean will_write
,DConfWatchFunc watch_func
,gpointer user_data
,GDestroyNotify notify
); void dconf_client_new_async (const gchar *context
,gboolean will_write
,DConfWatchFunc watch_func
,gpointer watch_func_data
,GDestroyNotify notify
,GAsyncReadyCallback callback
,gpointer user_data
); DConfClient * dconf_client_new_finish (GAsyncResult *result
); GVariant * dconf_client_read (DConfClient *client
,const gchar *key
); GVariant * dconf_client_read_default (DConfClient *client
,const gchar *key
); GVariant * dconf_client_read_no_default (DConfClient *client
,const gchar *key
); gchar ** dconf_client_list (DConfClient *client
,const gchar *dir
,gsize *length
); gboolean dconf_client_is_writable (DConfClient *client
,const gchar *path
,GError **error
); gboolean dconf_client_write (DConfClient *client
,const gchar *key
,GVariant *value
,gchar **tag
,GCancellable *cancellable
,GError **error
); void dconf_client_write_async (DConfClient *client
,const gchar *key
,GVariant *value
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean dconf_client_write_finish (DConfClient *client
,GAsyncResult *result
,gchar **tag
,GError **error
); gboolean dconf_client_set_locked (DConfClient *client
,const gchar *path
,gboolean locked
,GCancellable *cancellable
,GError **error
); void dconf_client_set_locked_async (DConfClient *client
,const gchar *path
,gboolean locked
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean dconf_client_set_locked_finish (DConfClient *client
,GAsyncResult *result
,GError **error
); gboolean dconf_client_write_many (DConfClient *client
,const gchar *prefix
,const gchar * const *keys
,GVariant **values
,gchar **tag
,GCancellable *cancellable
,GError **error
); void dconf_client_write_many_async (DConfClient *client
,const gchar *prefix
,const gchar * const *keys
,GVariant **values
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean dconf_client_write_many_finish (DConfClient *client
,GAsyncResult *result
,gchar **tag
,GError **error
); gboolean dconf_client_watch (DConfClient *client
,const gchar *name
,GError **error
); void dconf_client_watch_async (DConfClient *client
,const gchar *name
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean dconf_client_watch_finish (DConfClient *client
,GAsyncResult *result
,gpointer user_data
); gboolean dconf_client_unwatch (DConfClient *client
,const gchar *name
,GError **error
); void dconf_client_unwatch_async (DConfClient *client
,const gchar *name
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean dconf_client_unwatch_finish (DConfClient *client
,GAsyncResult *result
,gpointer user_data
);
void (*DConfWatchFunc) (DConfClient *client
,const gchar *tag
,const gchar *path
,const gchar * const *items
,gpointer user_data
);
DConfClient * dconf_client_new (const gchar *context
,gboolean will_write
,DConfWatchFunc watch_func
,gpointer user_data
,GDestroyNotify notify
);
Creates a new DConfClient for the given context.
If will_write
is FALSE
then you will not be able to use the created
client to write. The benefit of this is that when combined with
watch_func
being NULL
, no connection to D-Bus is required.
|
the context string (must by NULL for now)
|
|
TRUE if you intend to use the client to write
|
|
the function to call when changes occur |
|
the user_data to pass to watch_func
|
|
the function to free user_data when no longer needed
Returns: a new DConfClient
|
void dconf_client_new_async (const gchar *context
,gboolean will_write
,DConfWatchFunc watch_func
,gpointer watch_func_data
,GDestroyNotify notify
,GAsyncReadyCallback callback
,gpointer user_data
);
GVariant * dconf_client_read (DConfClient *client
,const gchar *key
);
Reads the value named by key
from dconf. If no such value exists,
NULL
is returned.
|
a DConfClient |
|
a valid dconf key
Returns: the value corresponding to key , or NULL if there is none
|
GVariant * dconf_client_read_default (DConfClient *client
,const gchar *key
);
Reads the value named by key
from any existing default/mandatory
databases but ignoring any value set by the user. The result is as
if the named key had just been reset.
|
a DConfClient |
|
a valid dconf key
Returns: the default value corresponding to key , or NULL if there
is none
|
GVariant * dconf_client_read_no_default (DConfClient *client
,const gchar *key
);
Reads the value named by key
as set by the user, ignoring any
default/mandatory databases. Normal applications will never want to
do this, but it may be useful for administrative or configuration
tweaking utilities to have access to this information.
Note that in the case of mandatory keys, the result of
dconf_client_read_no_default()
with a fallback to
dconf_client_read_default()
is not necessarily the same as the result
of a dconf_client_read()
. This is because the user may have set a
value before the key became marked as mandatory, in which case this
call will see the user's (otherwise inaccessible) key.
|
a DConfClient |
|
a valid dconf key
Returns: the user value corresponding to key , or NULL if there is
none
|
gchar ** dconf_client_list (DConfClient *client
,const gchar *dir
,gsize *length
);
Lists the keys and dirs located directly below dir
.
You should free the return result with g_strfreev()
when it is no
longer needed.
|
a DConfClient |
|
a dconf dir |
|
the paths located directly below dir . [array length=length]
|
gboolean dconf_client_is_writable (DConfClient *client
,const gchar *path
,GError **error
);
gboolean dconf_client_write (DConfClient *client
,const gchar *key
,GVariant *value
,gchar **tag
,GCancellable *cancellable
,GError **error
);
Write a value to the given key
, or reset key
to its default value.
If value
is NULL
then key
is reset to its default value (which may
be completely unset), otherwise value
becomes the new value.
If tag
is non-NULL
then it is set to the unique tag associated with
this write. This is the same tag that appears in change
notifications.
|
a DConfClient |
|
a dconf key |
|
a GVariant, or NULL . [allow-none]
|
|
the tag from this write. [out][allow-none] |
|
a GCancellable, or NULL
|
|
a pointer to a GError, or NULL
Returns: TRUE if the write is successful
|
void dconf_client_write_async (DConfClient *client
,const gchar *key
,GVariant *value
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Writes a value to the given key
, or reset key
to its default value.
This is the asynchronous version of dconf_client_write()
. You should
call dconf_client_write_finish()
from callback
to collect the
result.
|
a DConfClient |
|
a dconf key |
|
a GVariant, or NULL . [allow-none]
|
|
a GCancellable, or NULL
|
|
the function to call when complete |
|
the user data for callback
|
gboolean dconf_client_write_finish (DConfClient *client
,GAsyncResult *result
,gchar **tag
,GError **error
);
Collects the result from a prior call to dconf_client_write_async()
.
|
a DConfClient |
|
the GAsyncResult passed to the GAsyncReadyCallback |
|
the tag from this write. [out][allow-none] |
|
a pointer to a GError, or NULL
|
gboolean dconf_client_set_locked (DConfClient *client
,const gchar *path
,gboolean locked
,GCancellable *cancellable
,GError **error
);
Marks a dconf path as being locked.
Locks do not affect writes to this DConfClient. You can still write to a key that is marked as being locked without problems.
Locks are only effective when they are set on a database that is being used as the source of default/mandatory values. In that case, the lock will prevent writes from occuring to the database that has this database as its defaults.
|
a DConfClient |
|
a dconf path |
|
TRUE to lock, FALSE to unlock
|
|
a GCancellable, or NULL
|
|
a pointer to a GError, or NULL
Returns: TRUE if setting the lock was successful
|
void dconf_client_set_locked_async (DConfClient *client
,const gchar *path
,gboolean locked
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
gboolean dconf_client_set_locked_finish (DConfClient *client
,GAsyncResult *result
,GError **error
);
gboolean dconf_client_write_many (DConfClient *client
,const gchar *prefix
,const gchar * const *keys
,GVariant **values
,gchar **tag
,GCancellable *cancellable
,GError **error
);
void dconf_client_write_many_async (DConfClient *client
,const gchar *prefix
,const gchar * const *keys
,GVariant **values
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
gboolean dconf_client_write_many_finish (DConfClient *client
,GAsyncResult *result
,gchar **tag
,GError **error
);
gboolean dconf_client_watch (DConfClient *client
,const gchar *name
,GError **error
);
void dconf_client_watch_async (DConfClient *client
,const gchar *name
,GAsyncReadyCallback callback
,gpointer user_data
);
gboolean dconf_client_watch_finish (DConfClient *client
,GAsyncResult *result
,gpointer user_data
);
gboolean dconf_client_unwatch (DConfClient *client
,const gchar *name
,GError **error
);
void dconf_client_unwatch_async (DConfClient *client
,const gchar *name
,GAsyncReadyCallback callback
,gpointer user_data
);
gboolean dconf_client_unwatch_finish (DConfClient *client
,GAsyncResult *result
,gpointer user_data
);