modest reference manual | ||||
---|---|---|---|---|
ModestConf; GObject* modest_conf_new (void); gchar* modest_conf_get_string (ModestConf *self, const gchar *key, GError **err); int modest_conf_get_int (ModestConf *self, const gchar *key, GError **err); gboolean modest_conf_get_bool (ModestConf *self, const gchar *key, GError **err); gboolean modest_conf_set_string (ModestConf *self, const gchar *key, const gchar *val, GError **err); gboolean modest_conf_set_int (ModestConf *self, const gchar *key, int val, GError **err); gboolean modest_conf_set_bool (ModestConf *self, const gchar *key, gboolean val, GError **err); GSList* modest_conf_list_subkeys (ModestConf *self, const gchar *key, GError **err); gboolean modest_conf_remove_key (ModestConf *self, const gchar *key, GError **err); gboolean modest_conf_key_exists (ModestConf *self, const gchar *key, GError **err);
GObject* modest_conf_new (void);
create a new modest ModestConf object.
Returns : | a new ModestConf instance, or NULL in case of any error |
gchar* modest_conf_get_string (ModestConf *self, const gchar *key, GError **err);
get a string from the configuration system
self : |
self a ModestConf instance |
key : |
the key of the value to retrieve |
err : |
a GError ptr, or NULL to ignore. |
Returns : | a newly allocated string with the value for the key,
or NULL in case of error. err gives details in case of error
|
int modest_conf_get_int (ModestConf *self, const gchar *key, GError **err);
get an integer from the configuration system
self : |
self a ModestConf instance |
key : |
the key of the value to retrieve |
err : |
a GError ptr, or NULL to ignore. |
Returns : | an integer with the value for the key, or -1 in case of error
(of course, -1 can also be returned in non-error cases).
err gives details in case of error
|
gboolean modest_conf_get_bool (ModestConf *self, const gchar *key, GError **err);
get a boolean value from the configuration system
self : |
self a ModestConf instance |
key : |
the key of the value to retrieve |
err : |
a GError ptr, or NULL to ignore. |
Returns : | a boolean value with the value for the key, or -1 in case of error
(of course, -1 can also be returned in non-error cases).
err gives details in case of error
|
gboolean modest_conf_set_string (ModestConf *self, const gchar *key, const gchar *val, GError **err);
store a string value in the configuration system
self : |
a ModestConf instance |
key : |
the key of the value to set |
val : |
the value to set |
err : |
a GError ptr, or NULL if not interested. |
Returns : | TRUE if succeeded or FALSE in case of error.
err gives details in case of error
|
gboolean modest_conf_set_int (ModestConf *self, const gchar *key, int val, GError **err);
store an integer value in the configuration system
self : |
a ModestConf instance |
key : |
the key of the value to set |
val : |
the value to set |
err : |
a GError ptr, or NULL if not interested. |
Returns : | TRUE if succeeded or FALSE in case of error.
err gives details in case of error
|
gboolean modest_conf_set_bool (ModestConf *self, const gchar *key, gboolean val, GError **err);
store a boolean value in the configuration system
self : |
a ModestConf instance |
key : |
the key of the value to set |
val : |
the value to set |
err : |
a GError ptr, or NULL if not interested. |
Returns : | TRUE if succeeded or FALSE in case of error.
err gives details in case of error
|
GSList* modest_conf_list_subkeys (ModestConf *self, const gchar *key, GError **err);
list all the subkeys for a given key
self : |
a ModestConf instance |
key : |
the key whose subkeys will be listed |
err : |
a GError ptr, or NULL if not interested. |
Returns : | a newly allocated list or NULL in case of error
the returned GSList must be freed by the caller
err gives details in case of error
|
gboolean modest_conf_remove_key (ModestConf *self, const gchar *key, GError **err);
attempts to remove key
and all its subkeys
self : |
a ModestConf instance |
key : |
the key to remove |
err : |
a GError ptr, or NULL if not interested. |
Returns : | TRUE if succeeded or FALSE in case of error.
err gives details in case of error
|
gboolean modest_conf_key_exists (ModestConf *self, const gchar *key, GError **err);
checks if the given key exists in the configuration system
self : |
a ModestConf instance |
key : |
the key to remove |
err : |
a GError ptr, or NULL if not interested. |
Returns : | TRUE if exists, FALSE otherwise.
err gives details in case of error
|