annotate src/prefs.h @ 10012:a38881ec9c0f

[gaim-migrate @ 10929] i'm fairly certain this is all better committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 11 Sep 2004 05:41:50 +0000
parents db62420a53a2
children 2c8a9f9a71e6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
1 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
2 * @file prefs.h Prefs API
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
3 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
4 * gaim
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
5 *
8046
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 6693
diff changeset
6 * Gaim is the legal property of its developers, whose names are too numerous
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 6693
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 6693
diff changeset
8 * source distribution.
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
9 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
13 * (at your option) any later version.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
14 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
18 * GNU General Public License for more details.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
19 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
23 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
24 */
9713
db62420a53a2 [gaim-migrate @ 10574]
Mark Doliner <mark@kingant.net>
parents: 9619
diff changeset
25 #ifndef _GAIM_PREFS_H_
db62420a53a2 [gaim-migrate @ 10574]
Mark Doliner <mark@kingant.net>
parents: 9619
diff changeset
26 #define _GAIM_PREFS_H_
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
27
5638
0bdfa28c678e [gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents: 5561
diff changeset
28 #include <glib.h>
0bdfa28c678e [gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents: 5561
diff changeset
29
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
30 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
31 * Pref data types.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
32 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
33 typedef enum _GaimPrefType
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
34 {
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
35 GAIM_PREF_NONE,
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
36 GAIM_PREF_BOOLEAN,
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
37 GAIM_PREF_INT,
5561
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
38 GAIM_PREF_STRING,
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
39 GAIM_PREF_STRING_LIST
5944
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
40
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
41 } GaimPrefType;
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
42
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
43 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
44 * Pref change callback type
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
45 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
46
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
47 typedef void (*GaimPrefCallback) (const char *name, GaimPrefType type,
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
48 gpointer val, gpointer data);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
49
5944
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
50 #ifdef __cplusplus
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
51 extern "C" {
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
52 #endif
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
53
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
54 /**************************************************************************/
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
55 /** @name Prefs API */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
56 /**************************************************************************/
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
57 /*@{*/
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
58
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
59 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
60 * Initialize core prefs
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
61 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
62 void gaim_prefs_init();
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
63
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
64 /**
8235
63c7a16a2c09 [gaim-migrate @ 8958]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
65 * Uninitializes the prefs subsystem.
63c7a16a2c09 [gaim-migrate @ 8958]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
66 */
63c7a16a2c09 [gaim-migrate @ 8958]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
67 void gaim_prefs_uninit(void);
63c7a16a2c09 [gaim-migrate @ 8958]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
68
63c7a16a2c09 [gaim-migrate @ 8958]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
69 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
70 * Add a new typeless pref.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
71 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
72 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
73 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
74 void gaim_prefs_add_none(const char *name);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
75
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
76 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
77 * Add a new boolean pref.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
78 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
79 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
80 * @param value The initial value to set
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
81 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
82 void gaim_prefs_add_bool(const char *name, gboolean value);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
83
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
84 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
85 * Add a new integer pref.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
86 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
87 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
88 * @param value The initial value to set
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
89 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
90 void gaim_prefs_add_int(const char *name, int value);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
91
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
92 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
93 * Add a new string pref.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
94 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
95 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
96 * @param value The initial value to set
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
97 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
98 void gaim_prefs_add_string(const char *name, const char *value);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
99
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
100 /**
5561
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
101 * Add a new string list pref.
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
102 *
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
103 * @param name The name of the pref
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
104 * @param value The initial value to set
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
105 */
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
106 void gaim_prefs_add_string_list(const char *name, GList *value);
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
107
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
108 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
109 * Remove a pref.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
110 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
111 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
112 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
113 void gaim_prefs_remove(const char *name);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
114
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
115 /**
6693
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
116 * Rename a pref
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
117 *
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
118 * @param oldname The old name of the pref
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
119 * @param newname The new name for the pref
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
120 */
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
121 void gaim_prefs_rename(const char *oldname, const char *newname);
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
122
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
123 /**
8705
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
124 * Rename a boolean pref, toggling it's value
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
125 *
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
126 * @param oldname The old name of the pref
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
127 * @param newname The new name for the pref
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
128 */
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
129 void gaim_prefs_rename_boolean_toggle(const char *oldname, const char *newname);
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
130
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
131 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
132 * Remove all prefs.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
133 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
134 void gaim_prefs_destroy();
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
135
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
136 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
137 * Set raw pref value
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
138 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
139 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
140 * @param value The value to set
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
141 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
142 void gaim_prefs_set_generic(const char *name, gpointer value);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
143
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
144 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
145 * Set boolean pref value
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
146 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
147 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
148 * @param value The value to set
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
149 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
150 void gaim_prefs_set_bool(const char *name, gboolean value);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
151
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
152 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
153 * Set integer pref value
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
154 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
155 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
156 * @param value The value to set
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
157 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
158 void gaim_prefs_set_int(const char *name, int value);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
159
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
160 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
161 * Set string pref value
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
162 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
163 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
164 * @param value The value to set
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
165 */
5451
e1cc0c67e123 [gaim-migrate @ 5839]
Nathan Walp <nwalp@pidgin.im>
parents: 5441
diff changeset
166 void gaim_prefs_set_string(const char *name, const char *value);
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
167
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
168 /**
5561
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
169 * Set string pref value
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
170 *
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
171 * @param name The name of the pref
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
172 * @param value The value to set
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
173 */
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
174 void gaim_prefs_set_string_list(const char *name, GList *value);
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
175
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
176 /**
9611
5e78d07f6b36 [gaim-migrate @ 10454]
Tim Ringenbach <marv@pidgin.im>
parents: 8900
diff changeset
177 * Check if a pref exists
5e78d07f6b36 [gaim-migrate @ 10454]
Tim Ringenbach <marv@pidgin.im>
parents: 8900
diff changeset
178 *
9619
da88e2cd5c53 [gaim-migrate @ 10463]
Mark Doliner <mark@kingant.net>
parents: 9611
diff changeset
179 * @param name The name of the pref
da88e2cd5c53 [gaim-migrate @ 10463]
Mark Doliner <mark@kingant.net>
parents: 9611
diff changeset
180 * @return TRUE if the pref exists. Otherwise FALSE.
9611
5e78d07f6b36 [gaim-migrate @ 10454]
Tim Ringenbach <marv@pidgin.im>
parents: 8900
diff changeset
181 */
5e78d07f6b36 [gaim-migrate @ 10454]
Tim Ringenbach <marv@pidgin.im>
parents: 8900
diff changeset
182 gboolean gaim_prefs_exists(const char *name);
5e78d07f6b36 [gaim-migrate @ 10454]
Tim Ringenbach <marv@pidgin.im>
parents: 8900
diff changeset
183
5e78d07f6b36 [gaim-migrate @ 10454]
Tim Ringenbach <marv@pidgin.im>
parents: 8900
diff changeset
184 /**
6538
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
185 * Get pref type
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
186 *
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
187 * @param name The name of the pref
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
188 * @return The type of the pref
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
189 */
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
190 GaimPrefType gaim_prefs_get_type(const char *name);
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
191
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
192 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
193 * Get boolean pref value
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
194 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
195 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
196 * @return The value of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
197 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
198 gboolean gaim_prefs_get_bool(const char *name);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
199
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
200 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
201 * Get integer pref value
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
202 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
203 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
204 * @return The value of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
205 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
206 int gaim_prefs_get_int(const char *name);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
207
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
208 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
209 * Get string pref value
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
210 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
211 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
212 * @return The value of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
213 */
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5534
diff changeset
214 const char *gaim_prefs_get_string(const char *name);
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
215
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
216 /**
5561
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
217 * Get string pref value
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
218 *
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
219 * @param name The name of the pref
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
220 * @return The value of the pref
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
221 */
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
222 GList *gaim_prefs_get_string_list(const char *name);
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
223
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
224 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
225 * Add a callback to a pref (and its children)
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
226 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
227 guint gaim_prefs_connect_callback(const char *name, GaimPrefCallback cb,
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
228 gpointer data);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
229
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
230 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
231 * Remove a callback to a pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
232 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
233 void gaim_prefs_disconnect_callback(guint callback_id);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
234
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
235 /**
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5638
diff changeset
236 * Trigger callbacks as if the pref changed
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5638
diff changeset
237 */
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5638
diff changeset
238 void gaim_prefs_trigger_callback(const char *name);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5638
diff changeset
239
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5638
diff changeset
240 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
241 * Read preferences
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
242 */
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5534
diff changeset
243 gboolean gaim_prefs_load();
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
244
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
245 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
246 * Force an immediate write of preferences
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
247 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
248 void gaim_prefs_sync();
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
249
8900
7a67c459ab8f [gaim-migrate @ 9669]
Mark Doliner <mark@kingant.net>
parents: 8705
diff changeset
250 /**
7a67c459ab8f [gaim-migrate @ 9669]
Mark Doliner <mark@kingant.net>
parents: 8705
diff changeset
251 * Rename legacy prefs and delete some that no longer exist.
7a67c459ab8f [gaim-migrate @ 9669]
Mark Doliner <mark@kingant.net>
parents: 8705
diff changeset
252 */
7a67c459ab8f [gaim-migrate @ 9669]
Mark Doliner <mark@kingant.net>
parents: 8705
diff changeset
253 void gaim_prefs_update_old();
7a67c459ab8f [gaim-migrate @ 9669]
Mark Doliner <mark@kingant.net>
parents: 8705
diff changeset
254
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
255 /*@}*/
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
256
5944
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
257 #ifdef __cplusplus
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
258 }
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
259 #endif
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
260
9713
db62420a53a2 [gaim-migrate @ 10574]
Mark Doliner <mark@kingant.net>
parents: 9619
diff changeset
261 #endif /* _GAIM_PREFS_H_ */