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