GnuCash  5.6-150-g038405b370+
gnc-gsettings.h
Go to the documentation of this file.
1 /********************************************************************\
2  * gnc-gsettings.h -- utility functions for storing/retrieving *
3  * data in the GSettings database for GnuCash *
4  * Copyright (C) 2013 Geert Janssens <geert@kobaltwit.be> *
5  * *
6  * This program is free software; you can redistribute it and/or *
7  * modify it under the terms of the GNU General Public License as *
8  * published by the Free Software Foundation; either version 2 of *
9  * the License, or (at your option) any later version. *
10  * *
11  * This program is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License*
17  * along with this program; if not, contact: *
18  * *
19  * Free Software Foundation Voice: +1-617-542-5942 *
20  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
21  * Boston, MA 02110-1301, USA gnu@gnu.org *
22  * *
23 \********************************************************************/
24 
50 #ifndef GNC_GSETTINGS_H
51 #define GNC_GSETTINGS_H
52 
53 #include <glib.h>
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
63 const gchar *gnc_gsettings_get_prefix (void);
64 
65 
68 void gnc_gsettings_block_all (void);
69 
70 
73 void gnc_gsettings_unblock_all (void);
74 
75 
100 gulong gnc_gsettings_register_cb (const char *schema,
101  const gchar *key,
102  gpointer func,
103  gpointer user_data);
104 
105 
123 void gnc_gsettings_remove_cb_by_func (const gchar *schema,
124  const gchar *key,
125  gpointer func,
126  gpointer user_data);
127 
128 
140 void gnc_gsettings_remove_cb_by_id (const gchar *schema,
141  guint id);
142 
143 
158 guint gnc_gsettings_register_any_cb (const gchar *schema,
159  gpointer func,
160  gpointer user_data);
161 
162 
183 void gnc_gsettings_remove_any_cb_by_func (const gchar *schema,
184  gpointer func,
185  gpointer user_data);
186 
187 
208 void gnc_gsettings_bind (const gchar *schema,
209  /*@ null @*/ const gchar *key,
210  /*@ null @*/ const gchar *value,
211  gpointer object,
212  const gchar *property);
213 
214 
240 gboolean gnc_gsettings_get_bool (const gchar *schema,
241  /*@ null @*/ const gchar *key);
242 
266 gint gnc_gsettings_get_int (const gchar *schema, const gchar *key);
267 
291 gdouble gnc_gsettings_get_float (const gchar *schema, const gchar *key);
292 
317 gchar *gnc_gsettings_get_string (const gchar *schema, const gchar *key);
318 
342 gint gnc_gsettings_get_enum (const gchar *schema, const gchar *key);
343 
371 GVariant *gnc_gsettings_get_value (const gchar *schema, const gchar *key);
372 
401 gboolean gnc_gsettings_set_bool (const gchar *schema, const gchar *key,
402  gboolean value);
403 
425 gboolean gnc_gsettings_set_int (const gchar *schema, const gchar *key,
426  gint value);
427 
449 gboolean gnc_gsettings_set_float (const gchar *schema, const gchar *key,
450  gdouble value);
451 
452 
476 gboolean gnc_gsettings_set_string (const gchar *schema, const gchar *key,
477  const gchar *value);
478 
500 gboolean gnc_gsettings_set_enum (const gchar *schema, const gchar *key,
501  gint value);
502 
527 gboolean gnc_gsettings_set_value (const gchar *schema, const gchar *key,
528  GVariant *value);
529 
549 void gnc_gsettings_reset (const gchar *schema, const gchar *key);
550 
567 void gnc_gsettings_reset_schema (const gchar *schema);
568 
574 void gnc_gsettings_load_backend (void);
575 
578 void gnc_gsettings_shutdown (void);
579 
588 
589 #ifdef __cplusplus
590 }
591 #endif
592 
593 #endif /* GNC_GSETTINGS_H */
594 
gboolean gnc_gsettings_set_int(const gchar *schema, const gchar *key, gint value)
Store an integer value into GSettings.
gboolean gnc_gsettings_set_float(const gchar *schema, const gchar *key, gdouble value)
Store a float value into GSettings.
gint gnc_gsettings_get_int(const gchar *schema, const gchar *key)
Get an integer value from GSettings.
void gnc_gsettings_remove_any_cb_by_func(const gchar *schema, gpointer func, gpointer user_data)
Remove a function that was registered for a callback when any key in the given settings schema change...
gboolean gnc_gsettings_set_enum(const gchar *schema, const gchar *key, gint value)
Store an enum value into GSettings.
GVariant * gnc_gsettings_get_value(const gchar *schema, const gchar *key)
Get an arbitrary combination of values from GSettings.
guint gnc_gsettings_register_any_cb(const gchar *schema, gpointer func, gpointer user_data)
Register a callback for when any key in the settings schema is changed.
void gnc_gsettings_unblock_all(void)
UnBlock all prefs callbacks, used while preference dialog is loaded.
void gnc_gsettings_reset_schema(const gchar *schema)
Reset all keys in a schema to their default values in GSettings.
void gnc_gsettings_shutdown(void)
Free the GSettings resources.
gdouble gnc_gsettings_get_float(const gchar *schema, const gchar *key)
Get an float value from GSettings.
void gnc_gsettings_reset(const gchar *schema, const gchar *key)
Reset a key to its default value in GSettings.
gchar * gnc_gsettings_get_string(const gchar *schema, const gchar *key)
Get a string value from GSettings.
void gnc_gsettings_bind(const gchar *schema, const gchar *key, const gchar *value, gpointer object, const gchar *property)
Bind a setting to a g_object property.
gint gnc_gsettings_get_enum(const gchar *schema, const gchar *key)
Get an enum value from GSettings.
gboolean gnc_gsettings_set_bool(const gchar *schema, const gchar *key, gboolean value)
Store a boolean value into GSettings.
void gnc_gsettings_load_backend(void)
Configure gsettings as the backend for the gnucash preferences api.
void gnc_gsettings_version_upgrade(void)
Check whether we need to adjust the user settings to a newer version.
void gnc_gsettings_block_all(void)
Block all prefs callbacks, used while preference dialog is loaded.
gboolean gnc_gsettings_get_bool(const gchar *schema, const gchar *key)
Get a boolean value from GSettings.
const gchar * gnc_gsettings_get_prefix(void)
Get the default gsettings schema prefix.
void gnc_gsettings_remove_cb_by_id(const gchar *schema, guint id)
Remove a function that was registered for a callback when a specific key in the settings schema chang...
gboolean gnc_gsettings_set_value(const gchar *schema, const gchar *key, GVariant *value)
Store an arbitrary combination of values into GSettings.
gulong gnc_gsettings_register_cb(const char *schema, const gchar *key, gpointer func, gpointer user_data)
Register a callback for when a specific key in the settings schema is changed.
gboolean gnc_gsettings_set_string(const gchar *schema, const gchar *key, const gchar *value)
Store a string into GSettings.
void gnc_gsettings_remove_cb_by_func(const gchar *schema, const gchar *key, gpointer func, gpointer user_data)
Remove a function that was registered for a callback when a specific key in the settings schema chang...