dconf-client

dconf-client

Synopsis

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);

Object Hierarchy

  GObject
   +----DConfClient

Description

Details

DConfClientClass


DConfClient

typedef struct _DConfClient DConfClient;

DConfWatchFunc ()

void                (*DConfWatchFunc)                   (DConfClient *client,
                                                         const gchar *tag,
                                                         const gchar *path,
                                                         const gchar * const *items,
                                                         gpointer user_data);

dconf_client_new ()

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.

context :

the context string (must by NULL for now)

will_write :

TRUE if you intend to use the client to write

watch_func :

the function to call when changes occur

user_data :

the user_data to pass to watch_func

notify :

the function to free user_data when no longer needed Returns: a new DConfClient

dconf_client_new_async ()

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);

dconf_client_new_finish ()

DConfClient *       dconf_client_new_finish             (GAsyncResult *result);

dconf_client_read ()

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.

client :

a DConfClient

key :

a valid dconf key Returns: the value corresponding to key, or NULL if there is none

dconf_client_read_default ()

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.

client :

a DConfClient

key :

a valid dconf key Returns: the default value corresponding to key, or NULL if there is none

dconf_client_read_no_default ()

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.

client :

a DConfClient

key :

a valid dconf key Returns: the user value corresponding to key, or NULL if there is none

dconf_client_list ()

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.

client :

a DConfClient

dir :

a dconf dir

length :

the paths located directly below dir. [array length=length]

dconf_client_is_writable ()

gboolean            dconf_client_is_writable            (DConfClient *client,
                                                         const gchar *path,
                                                         GError **error);

dconf_client_write ()

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.

client :

a DConfClient

key :

a dconf key

value :

a GVariant, or NULL. [allow-none]

tag :

the tag from this write. [out][allow-none]

cancellable :

a GCancellable, or NULL

error :

a pointer to a GError, or NULL Returns: TRUE if the write is successful

dconf_client_write_async ()

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.

client :

a DConfClient

key :

a dconf key

value :

a GVariant, or NULL. [allow-none]

cancellable :

a GCancellable, or NULL

callback :

the function to call when complete

user_data :

the user data for callback

dconf_client_write_finish ()

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().

client :

a DConfClient

result :

the GAsyncResult passed to the GAsyncReadyCallback

tag :

the tag from this write. [out][allow-none]

error :

a pointer to a GError, or NULL

dconf_client_set_locked ()

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.

client :

a DConfClient

path :

a dconf path

locked :

TRUE to lock, FALSE to unlock

cancellable :

a GCancellable, or NULL

error :

a pointer to a GError, or NULL Returns: TRUE if setting the lock was successful

dconf_client_set_locked_async ()

void                dconf_client_set_locked_async       (DConfClient *client,
                                                         const gchar *path,
                                                         gboolean locked,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

dconf_client_set_locked_finish ()

gboolean            dconf_client_set_locked_finish      (DConfClient *client,
                                                         GAsyncResult *result,
                                                         GError **error);

dconf_client_write_many ()

gboolean            dconf_client_write_many             (DConfClient *client,
                                                         const gchar *prefix,
                                                         const gchar * const *keys,
                                                         GVariant **values,
                                                         gchar **tag,
                                                         GCancellable *cancellable,
                                                         GError **error);

dconf_client_write_many_async ()

void                dconf_client_write_many_async       (DConfClient *client,
                                                         const gchar *prefix,
                                                         const gchar * const *keys,
                                                         GVariant **values,
                                                         GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

dconf_client_write_many_finish ()

gboolean            dconf_client_write_many_finish      (DConfClient *client,
                                                         GAsyncResult *result,
                                                         gchar **tag,
                                                         GError **error);

dconf_client_watch ()

gboolean            dconf_client_watch                  (DConfClient *client,
                                                         const gchar *name,
                                                         GError **error);

dconf_client_watch_async ()

void                dconf_client_watch_async            (DConfClient *client,
                                                         const gchar *name,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

dconf_client_watch_finish ()

gboolean            dconf_client_watch_finish           (DConfClient *client,
                                                         GAsyncResult *result,
                                                         gpointer user_data);

dconf_client_unwatch ()

gboolean            dconf_client_unwatch                (DConfClient *client,
                                                         const gchar *name,
                                                         GError **error);

dconf_client_unwatch_async ()

void                dconf_client_unwatch_async          (DConfClient *client,
                                                         const gchar *name,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

dconf_client_unwatch_finish ()

gboolean            dconf_client_unwatch_finish         (DConfClient *client,
                                                         GAsyncResult *result,
                                                         gpointer user_data);