GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnc-prefs.h
Go to the documentation of this file.
1 /********************************************************************\
2  * gnc-prefs.h -- Api to load and store preferences to a *
3  * configurable backend *
4  * *
5  * Copyright (C) 2013 Geert Janssens <[email protected]> *
6  * *
7  * This program is free software; you can redistribute it and/or *
8  * modify it under the terms of the GNU General Public License as *
9  * published by the Free Software Foundation; either version 2 of *
10  * the License, or (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License*
18  * along with this program; if not, contact: *
19  * *
20  * Free Software Foundation Voice: +1-617-542-5942 *
21  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
22  * Boston, MA 02110-1301, USA [email protected] *
23  * *
24  ********************************************************************/
25 
45 #ifndef GNC_PREFS_H
46 #define GNC_PREFS_H
47 
48 #include <glib.h>
49 
50 /* Preference groups used across multiple modules */
51 #define GNC_PREFS_GROUP_GENERAL "general"
52 #define GNC_PREFS_GROUP_GENERAL_REGISTER "general.register"
53 #define GNC_PREFS_GROUP_GENERAL_REPORT "general.report"
54 #define GNC_PREFS_GROUP_WARNINGS "general.warnings"
55 #define GNC_PREFS_GROUP_WARNINGS_TEMP "warnings.temporary"
56 #define GNC_PREFS_GROUP_WARNINGS_PERM "warnings.permanent"
57 #define GNC_PREFS_GROUP_ACCT_SUMMARY "window.pages.account-tree.summary"
58 
59 /* Preference names used across multiple modules */
60 #define GNC_PREF_SAVE_GEOMETRY "save-window-geometry"
61 #define GNC_PREF_LAST_PATH "last-path"
62 #define GNC_PREF_USE_NEW "use-new-window"
63 #define GNC_PREF_ACCOUNTING_LABELS "use-accounting-labels"
64 #define GNC_PREF_ACCOUNT_SEPARATOR "account-separator"
65 #define GNC_PREF_NEGATIVE_IN_RED "negative-in-red"
66 #define GNC_PREF_NUM_SOURCE "num-source"
67 #define GNC_PREF_DATE_FORMAT "date-format"
68 #define GNC_PREF_DATE_COMPL_THISYEAR "date-completion-thisyear"
69 #define GNC_PREF_DATE_COMPL_SLIDING "date-completion-sliding"
70 #define GNC_PREF_DATE_BACKMONTHS "date-backmonths"
71 #define GNC_PREF_SHOW_LEAF_ACCT_NAMES "show-leaf-account-names"
72 #define GNC_PREF_ENTER_MOVES_TO_END "enter-moves-to-end"
73 /* Register preferences */
74 #define GNC_PREF_DRAW_HOR_LINES "draw-horizontal-lines"
75 #define GNC_PREF_DRAW_VERT_LINES "draw-vertical-lines"
76 #define GNC_PREF_ALT_COLOR_BY_TRANS "alternate-color-by-transaction"
77 #define GNC_PREF_USE_THEME_COLORS "use-theme-colors"
78 #define GNC_PREF_TAB_TRANS_MEMORISED "tab-to-transfer-on-memorised"
79 #define GNC_PREF_FUTURE_AFTER_BLANK "future-after-blank-transaction"
80 /* Date preferences */
81 #define GNC_PREF_START_CHOICE_ABS "start-choice-absolute"
82 #define GNC_PREF_START_CHOICE_REL "start-choice-relative"
83 #define GNC_PREF_START_DATE "start-date"
84 #define GNC_PREF_START_PERIOD "start-period"
85 #define GNC_PREF_END_CHOICE_ABS "end-choice-absolute"
86 #define GNC_PREF_END_CHOICE_REL "end-choice-relative"
87 #define GNC_PREF_END_DATE "end-date"
88 #define GNC_PREF_END_PERIOD "end-period"
89 /* Currency preferences */
90 #define GNC_PREF_CURRENCY_OTHER "currency-other"
91 #define GNC_PREF_CURRENCY_CHOICE_LOCALE "currency-choice-locale"
92 #define GNC_PREF_CURRENCY_CHOICE_OTHER "currency-choice-other"
93 
98 const gchar *gnc_prefs_get_namespace_regexp(void);
99 void gnc_prefs_set_namespace_regexp(const gchar *str);
100 
101 gboolean gnc_prefs_is_debugging_enabled(void);
102 void gnc_prefs_set_debugging(gboolean d);
103 
104 gboolean gnc_prefs_is_extra_enabled(void);
105 void gnc_prefs_set_extra(gboolean enabled);
106 
107 gboolean gnc_prefs_get_file_save_compressed(void);
108 void gnc_prefs_set_file_save_compressed(gboolean compressed);
109 
110 gint gnc_prefs_get_file_retention_policy(void);
111 void gnc_prefs_set_file_retention_policy(gint policy);
112 
113 gint gnc_prefs_get_file_retention_days(void);
114 void gnc_prefs_set_file_retention_days(gint days);
115 
116 guint gnc_prefs_get_long_version( void );
117 
123 gboolean gnc_prefs_is_set_up (void);
124 
149 gulong gnc_prefs_register_cb (const char *group,
150  const gchar *pref_name,
151  gpointer func,
152  gpointer user_data);
153 
154 
172 void gnc_prefs_remove_cb_by_func (const gchar *group,
173  const gchar *pref_name,
174  gpointer func,
175  gpointer user_data);
176 
177 
189 void gnc_prefs_remove_cb_by_id (const gchar *group,
190  guint id);
191 
192 
207 guint gnc_prefs_register_group_cb (const gchar *group,
208  gpointer func,
209  gpointer user_data);
210 
211 
232 void gnc_prefs_remove_group_cb_by_func (const gchar *group,
233  gpointer func,
234  gpointer user_data);
235 
236 
250 void gnc_prefs_bind (const gchar *group,
251  /*@ null @*/ const gchar *pref_name,
252  gpointer object,
253  const gchar *property);
254 
273 gboolean gnc_prefs_get_bool (const gchar *group,
274  /*@ null @*/ const gchar *pref_name);
275 
288 gint gnc_prefs_get_int (const gchar *group,
289  const gchar *pref_name);
290 
303 gint64 gnc_prefs_get_int64 (const gchar *group,
304  const gchar *pref_name);
305 
318 gdouble gnc_prefs_get_float (const gchar *group,
319  const gchar *pref_name);
320 
333 gchar *gnc_prefs_get_string (const gchar *group,
334  const gchar *pref_name);
335 
348 gint gnc_prefs_get_enum (const gchar *group,
349  const gchar *pref_name);
350 
364 void gnc_prefs_get_coords (const gchar *group,
365  const gchar *pref_name,
366  gdouble *x, gdouble *y);
367 
385 GVariant *gnc_prefs_get_value (const gchar *group,
386  const gchar *pref_name);
387 
407 gboolean gnc_prefs_set_bool (const gchar *group,
408  const gchar *pref_name,
409  gboolean value);
410 
423 gboolean gnc_prefs_set_int (const gchar *group,
424  const gchar *pref_name,
425  gint value);
426 
439 gboolean gnc_prefs_set_int64 (const gchar *group,
440  const gchar *pref_name,
441  gint64 value);
442 
455 gboolean gnc_prefs_set_float (const gchar *group,
456  const gchar *pref_name,
457  gdouble value);
458 
459 
474 gboolean gnc_prefs_set_string (const gchar *group,
475  const gchar *pref_name,
476  const gchar *value);
477 
490 gboolean gnc_prefs_set_enum (const gchar *group,
491  const gchar *pref_name,
492  gint value);
493 
509 gboolean gnc_prefs_set_coords (const gchar *group,
510  const gchar *pref_name,
511  gdouble x, gdouble y);
512 
526 gboolean gnc_prefs_set_value (const gchar *group,
527  const gchar *pref_name,
528  GVariant *value);
529 
537 void gnc_prefs_reset (const gchar *group,
538  const gchar *pref_name);
539 
544 void gnc_prefs_reset_group (const gchar *group);
545 
549 #endif /* GNC_PREFS_H */
550 
void gnc_prefs_reset_group(const gchar *group)
Definition: gnc-prefs.c:373
gboolean gnc_prefs_set_value(const gchar *group, const gchar *pref_name, GVariant *value)
Definition: gnc-prefs.c:355
gchar * gnc_prefs_get_string(const gchar *group, const gchar *pref_name)
Definition: gnc-prefs.c:237
gulong gnc_prefs_register_cb(const char *group, const gchar *pref_name, gpointer func, gpointer user_data)
Definition: gnc-prefs.c:128
gboolean gnc_prefs_set_int(const gchar *group, const gchar *pref_name, gint value)
Definition: gnc-prefs.c:293
void gnc_prefs_reset(const gchar *group, const gchar *pref_name)
Definition: gnc-prefs.c:366
gboolean gnc_prefs_set_string(const gchar *group, const gchar *pref_name, const gchar *value)
Definition: gnc-prefs.c:324
gint64 gnc_prefs_get_int64(const gchar *group, const gchar *pref_name)
Definition: gnc-prefs.c:216
gint gnc_prefs_get_int(const gchar *group, const gchar *pref_name)
Definition: gnc-prefs.c:206
void gnc_prefs_remove_cb_by_id(const gchar *group, guint id)
Definition: gnc-prefs.c:158
void gnc_prefs_bind(const gchar *group, const gchar *pref_name, gpointer object, const gchar *property)
Definition: gnc-prefs.c:186
gboolean gnc_prefs_set_bool(const gchar *group, const gchar *pref_name, gboolean value)
Definition: gnc-prefs.c:282
gboolean gnc_prefs_set_enum(const gchar *group, const gchar *pref_name, gint value)
Definition: gnc-prefs.c:335
gint gnc_prefs_get_enum(const gchar *group, const gchar *pref_name)
Definition: gnc-prefs.c:247
gboolean gnc_prefs_set_float(const gchar *group, const gchar *pref_name, gdouble value)
Definition: gnc-prefs.c:313
gboolean gnc_prefs_set_coords(const gchar *group, const gchar *pref_name, gdouble x, gdouble y)
Definition: gnc-prefs.c:346
void gnc_prefs_get_coords(const gchar *group, const gchar *pref_name, gdouble *x, gdouble *y)
Definition: gnc-prefs.c:257
void gnc_prefs_remove_group_cb_by_func(const gchar *group, gpointer func, gpointer user_data)
Definition: gnc-prefs.c:177
GVariant * gnc_prefs_get_value(const gchar *group, const gchar *pref_name)
Definition: gnc-prefs.c:272
guint gnc_prefs_register_group_cb(const gchar *group, gpointer func, gpointer user_data)
Definition: gnc-prefs.c:166
gboolean gnc_prefs_get_bool(const gchar *group, const gchar *pref_name)
Definition: gnc-prefs.c:196
gboolean gnc_prefs_is_set_up(void)
Definition: gnc-prefs.c:379
void gnc_prefs_remove_cb_by_func(const gchar *group, const gchar *pref_name, gpointer func, gpointer user_data)
Definition: gnc-prefs.c:148
gdouble gnc_prefs_get_float(const gchar *group, const gchar *pref_name)
Definition: gnc-prefs.c:227
gboolean gnc_prefs_set_int64(const gchar *group, const gchar *pref_name, gint64 value)
Definition: gnc-prefs.c:304