Thu, 20 Sep 2007 16:30:17 +0000
Use an independant status type for 'current media' stuff, instead of using
status attributes. This includes changes in both xmpp and msn.
Also, in MSN, CurrentMedia is sent with PSM if you turn on the status and
set the attributes on the account.
| 5441 | 1 | /** |
| 2 | * @file prefs.h Prefs API | |
|
10066
606927534c36
[gaim-migrate @ 11041]
Mark Doliner <markdoliner@pidgin.im>
parents:
9713
diff
changeset
|
3 | * @ingroup core |
|
20330
650a7af9c238
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@pidgin.im>
parents:
19859
diff
changeset
|
4 | */ |
|
650a7af9c238
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@pidgin.im>
parents:
19859
diff
changeset
|
5 | |
|
650a7af9c238
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@pidgin.im>
parents:
19859
diff
changeset
|
6 | /* purple |
| 5441 | 7 | * |
| 15884 | 8 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 10 | * source distribution. | |
| 5441 | 11 | * |
| 12 | * This program is free software; you can redistribute it and/or modify | |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18814
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5441 | 25 | * |
| 26 | */ | |
| 15884 | 27 | #ifndef _PURPLE_PREFS_H_ |
| 28 | #define _PURPLE_PREFS_H_ | |
| 5441 | 29 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5561
diff
changeset
|
30 | #include <glib.h> |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5561
diff
changeset
|
31 | |
| 5441 | 32 | /** |
| 33 | * Pref data types. | |
| 34 | */ | |
| 15884 | 35 | typedef enum _PurplePrefType |
| 5441 | 36 | { |
| 15884 | 37 | PURPLE_PREF_NONE, |
| 38 | PURPLE_PREF_BOOLEAN, | |
| 39 | PURPLE_PREF_INT, | |
| 40 | PURPLE_PREF_STRING, | |
| 41 | PURPLE_PREF_STRING_LIST, | |
| 42 | PURPLE_PREF_PATH, | |
| 43 | PURPLE_PREF_PATH_LIST | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
44 | |
| 15884 | 45 | } PurplePrefType; |
| 5441 | 46 | |
| 47 | /** | |
| 48 | * Pref change callback type | |
| 49 | */ | |
| 50 | ||
| 15884 | 51 | typedef void (*PurplePrefCallback) (const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12712
diff
changeset
|
52 | gconstpointer val, gpointer data); |
| 5441 | 53 | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
54 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
55 | extern "C" { |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
56 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
57 | |
| 5441 | 58 | /**************************************************************************/ |
|
17436
a3e9be0f17ef
- Added a description of preference grouping to the Prefs API code
William Ehlhardt <williamehlhardt@gmail.com>
parents:
15884
diff
changeset
|
59 | /** @name Prefs API |
|
a3e9be0f17ef
- Added a description of preference grouping to the Prefs API code
William Ehlhardt <williamehlhardt@gmail.com>
parents:
15884
diff
changeset
|
60 | Preferences are named according to a directory-like structure. |
|
a3e9be0f17ef
- Added a description of preference grouping to the Prefs API code
William Ehlhardt <williamehlhardt@gmail.com>
parents:
15884
diff
changeset
|
61 | Example: "/plugins/core/potato/is_from_idaho" (probably a boolean) */ |
| 5441 | 62 | /**************************************************************************/ |
| 63 | /*@{*/ | |
| 64 | ||
| 65 | /** | |
|
10443
aa7dcc1c796a
[gaim-migrate @ 11703]
Mark Doliner <markdoliner@pidgin.im>
parents:
10087
diff
changeset
|
66 | * Returns the prefs subsystem handle. |
|
aa7dcc1c796a
[gaim-migrate @ 11703]
Mark Doliner <markdoliner@pidgin.im>
parents:
10087
diff
changeset
|
67 | * |
|
aa7dcc1c796a
[gaim-migrate @ 11703]
Mark Doliner <markdoliner@pidgin.im>
parents:
10087
diff
changeset
|
68 | * @return The prefs subsystem handle. |
|
aa7dcc1c796a
[gaim-migrate @ 11703]
Mark Doliner <markdoliner@pidgin.im>
parents:
10087
diff
changeset
|
69 | */ |
| 15884 | 70 | void *purple_prefs_get_handle(void); |
|
10443
aa7dcc1c796a
[gaim-migrate @ 11703]
Mark Doliner <markdoliner@pidgin.im>
parents:
10087
diff
changeset
|
71 | |
|
aa7dcc1c796a
[gaim-migrate @ 11703]
Mark Doliner <markdoliner@pidgin.im>
parents:
10087
diff
changeset
|
72 | /** |
| 5441 | 73 | * Initialize core prefs |
| 74 | */ | |
| 15884 | 75 | void purple_prefs_init(void); |
| 5441 | 76 | |
| 77 | /** | |
| 8235 | 78 | * Uninitializes the prefs subsystem. |
| 79 | */ | |
| 15884 | 80 | void purple_prefs_uninit(void); |
| 8235 | 81 | |
| 82 | /** | |
| 5441 | 83 | * Add a new typeless pref. |
| 84 | * | |
| 85 | * @param name The name of the pref | |
| 86 | */ | |
| 15884 | 87 | void purple_prefs_add_none(const char *name); |
| 5441 | 88 | |
| 89 | /** | |
| 90 | * Add a new boolean pref. | |
| 91 | * | |
| 92 | * @param name The name of the pref | |
| 93 | * @param value The initial value to set | |
| 94 | */ | |
| 15884 | 95 | void purple_prefs_add_bool(const char *name, gboolean value); |
| 5441 | 96 | |
| 97 | /** | |
| 98 | * Add a new integer pref. | |
| 99 | * | |
| 100 | * @param name The name of the pref | |
| 101 | * @param value The initial value to set | |
| 102 | */ | |
| 15884 | 103 | void purple_prefs_add_int(const char *name, int value); |
| 5441 | 104 | |
| 105 | /** | |
| 106 | * Add a new string pref. | |
| 107 | * | |
| 108 | * @param name The name of the pref | |
| 109 | * @param value The initial value to set | |
| 110 | */ | |
| 15884 | 111 | void purple_prefs_add_string(const char *name, const char *value); |
| 5441 | 112 | |
| 113 | /** | |
| 5561 | 114 | * Add a new string list pref. |
| 115 | * | |
| 116 | * @param name The name of the pref | |
| 117 | * @param value The initial value to set | |
| 118 | */ | |
| 15884 | 119 | void purple_prefs_add_string_list(const char *name, GList *value); |
| 5561 | 120 | |
| 121 | /** | |
| 15370 | 122 | * Add a new path pref. |
| 123 | * | |
| 124 | * @param name The name of the pref | |
| 125 | * @param value The initial value to set | |
| 126 | */ | |
| 15884 | 127 | void purple_prefs_add_path(const char *name, const char *value); |
| 15370 | 128 | |
| 129 | /** | |
| 130 | * Add a new path list pref. | |
| 131 | * | |
| 132 | * @param name The name of the pref | |
| 133 | * @param value The initial value to set | |
| 134 | */ | |
| 15884 | 135 | void purple_prefs_add_path_list(const char *name, GList *value); |
| 15370 | 136 | |
| 137 | ||
| 138 | /** | |
| 5441 | 139 | * Remove a pref. |
| 140 | * | |
| 141 | * @param name The name of the pref | |
| 142 | */ | |
| 15884 | 143 | void purple_prefs_remove(const char *name); |
| 5441 | 144 | |
| 145 | /** | |
| 6693 | 146 | * Rename a pref |
| 147 | * | |
| 148 | * @param oldname The old name of the pref | |
| 149 | * @param newname The new name for the pref | |
| 150 | */ | |
| 15884 | 151 | void purple_prefs_rename(const char *oldname, const char *newname); |
| 6693 | 152 | |
| 153 | /** | |
| 8705 | 154 | * Rename a boolean pref, toggling it's value |
| 155 | * | |
| 156 | * @param oldname The old name of the pref | |
| 157 | * @param newname The new name for the pref | |
| 158 | */ | |
| 15884 | 159 | void purple_prefs_rename_boolean_toggle(const char *oldname, const char *newname); |
| 8705 | 160 | |
| 161 | /** | |
| 5441 | 162 | * Remove all prefs. |
| 163 | */ | |
| 15884 | 164 | void purple_prefs_destroy(void); |
| 5441 | 165 | |
| 166 | /** | |
| 167 | * Set raw pref value | |
| 168 | * | |
| 169 | * @param name The name of the pref | |
| 170 | * @param value The value to set | |
| 171 | */ | |
| 15884 | 172 | void purple_prefs_set_generic(const char *name, gpointer value); |
| 5441 | 173 | |
| 174 | /** | |
| 175 | * Set boolean pref value | |
| 176 | * | |
| 177 | * @param name The name of the pref | |
| 178 | * @param value The value to set | |
| 179 | */ | |
| 15884 | 180 | void purple_prefs_set_bool(const char *name, gboolean value); |
| 5441 | 181 | |
| 182 | /** | |
| 183 | * Set integer pref value | |
| 184 | * | |
| 185 | * @param name The name of the pref | |
| 186 | * @param value The value to set | |
| 187 | */ | |
| 15884 | 188 | void purple_prefs_set_int(const char *name, int value); |
| 5441 | 189 | |
| 190 | /** | |
| 191 | * Set string pref value | |
| 192 | * | |
| 193 | * @param name The name of the pref | |
| 194 | * @param value The value to set | |
| 195 | */ | |
| 15884 | 196 | void purple_prefs_set_string(const char *name, const char *value); |
| 5441 | 197 | |
| 198 | /** | |
| 15370 | 199 | * Set string list pref value |
| 5561 | 200 | * |
| 201 | * @param name The name of the pref | |
| 202 | * @param value The value to set | |
| 203 | */ | |
| 15884 | 204 | void purple_prefs_set_string_list(const char *name, GList *value); |
| 5561 | 205 | |
| 206 | /** | |
| 15370 | 207 | * Set path pref value |
| 208 | * | |
| 209 | * @param name The name of the pref | |
| 210 | * @param value The value to set | |
| 211 | */ | |
| 15884 | 212 | void purple_prefs_set_path(const char *name, const char *value); |
| 15370 | 213 | |
| 214 | /** | |
| 215 | * Set path list pref value | |
| 216 | * | |
| 217 | * @param name The name of the pref | |
| 218 | * @param value The value to set | |
| 219 | */ | |
| 15884 | 220 | void purple_prefs_set_path_list(const char *name, GList *value); |
| 15370 | 221 | |
| 222 | ||
| 223 | /** | |
| 9611 | 224 | * Check if a pref exists |
| 225 | * | |
|
9619
2d8adb92f665
[gaim-migrate @ 10463]
Mark Doliner <markdoliner@pidgin.im>
parents:
9611
diff
changeset
|
226 | * @param name The name of the pref |
|
2d8adb92f665
[gaim-migrate @ 10463]
Mark Doliner <markdoliner@pidgin.im>
parents:
9611
diff
changeset
|
227 | * @return TRUE if the pref exists. Otherwise FALSE. |
| 9611 | 228 | */ |
| 15884 | 229 | gboolean purple_prefs_exists(const char *name); |
| 9611 | 230 | |
| 231 | /** | |
| 6538 | 232 | * Get pref type |
| 233 | * | |
| 234 | * @param name The name of the pref | |
| 235 | * @return The type of the pref | |
| 236 | */ | |
| 15884 | 237 | PurplePrefType purple_prefs_get_type(const char *name); |
| 6538 | 238 | |
| 239 | /** | |
| 5441 | 240 | * Get boolean pref value |
| 241 | * | |
| 242 | * @param name The name of the pref | |
| 243 | * @return The value of the pref | |
| 244 | */ | |
| 15884 | 245 | gboolean purple_prefs_get_bool(const char *name); |
| 5441 | 246 | |
| 247 | /** | |
| 248 | * Get integer pref value | |
| 249 | * | |
| 250 | * @param name The name of the pref | |
| 251 | * @return The value of the pref | |
| 252 | */ | |
| 15884 | 253 | int purple_prefs_get_int(const char *name); |
| 5441 | 254 | |
| 255 | /** | |
| 256 | * Get string pref value | |
| 257 | * | |
| 258 | * @param name The name of the pref | |
| 259 | * @return The value of the pref | |
| 260 | */ | |
| 15884 | 261 | const char *purple_prefs_get_string(const char *name); |
| 5441 | 262 | |
| 263 | /** | |
|
10071
d2ba11541693
[gaim-migrate @ 11047]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
10066
diff
changeset
|
264 | * Get string list pref value |
| 5561 | 265 | * |
| 266 | * @param name The name of the pref | |
| 267 | * @return The value of the pref | |
| 268 | */ | |
| 15884 | 269 | GList *purple_prefs_get_string_list(const char *name); |
| 5561 | 270 | |
| 271 | /** | |
| 15370 | 272 | * Get path pref value |
| 273 | * | |
| 274 | * @param name The name of the pref | |
| 275 | * @return The value of the pref | |
| 276 | */ | |
| 15884 | 277 | const char *purple_prefs_get_path(const char *name); |
| 15370 | 278 | |
| 279 | /** | |
| 280 | * Get path list pref value | |
| 281 | * | |
| 282 | * @param name The name of the pref | |
| 283 | * @return The value of the pref | |
| 284 | */ | |
| 15884 | 285 | GList *purple_prefs_get_path_list(const char *name); |
| 15370 | 286 | |
|
18714
65048af91a2c
Add purple_prefs_get_children_names in purple. And update Changelog.API
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15884
diff
changeset
|
287 | /* |
|
65048af91a2c
Add purple_prefs_get_children_names in purple. And update Changelog.API
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15884
diff
changeset
|
288 | * Returns a list of children for a pref |
|
65048af91a2c
Add purple_prefs_get_children_names in purple. And update Changelog.API
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15884
diff
changeset
|
289 | * |
|
65048af91a2c
Add purple_prefs_get_children_names in purple. And update Changelog.API
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15884
diff
changeset
|
290 | * @param name The parent pref |
|
65048af91a2c
Add purple_prefs_get_children_names in purple. And update Changelog.API
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15884
diff
changeset
|
291 | * @return A list of newly allocated strings denoting the names of the children. |
|
65048af91a2c
Add purple_prefs_get_children_names in purple. And update Changelog.API
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15884
diff
changeset
|
292 | * Returns @c NULL if there are no children or if pref doesn't exist. |
|
65048af91a2c
Add purple_prefs_get_children_names in purple. And update Changelog.API
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15884
diff
changeset
|
293 | * The caller must free all the strings and the list. |
|
65048af91a2c
Add purple_prefs_get_children_names in purple. And update Changelog.API
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15884
diff
changeset
|
294 | */ |
|
65048af91a2c
Add purple_prefs_get_children_names in purple. And update Changelog.API
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15884
diff
changeset
|
295 | GList *purple_prefs_get_children_names(const char *name); |
| 15370 | 296 | |
| 297 | /** | |
| 5441 | 298 | * Add a callback to a pref (and its children) |
| 299 | */ | |
| 15884 | 300 | guint purple_prefs_connect_callback(void *handle, const char *name, PurplePrefCallback cb, |
| 5441 | 301 | gpointer data); |
| 302 | ||
| 303 | /** | |
| 304 | * Remove a callback to a pref | |
| 305 | */ | |
| 15884 | 306 | void purple_prefs_disconnect_callback(guint callback_id); |
| 5441 | 307 | |
| 308 | /** | |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10071
diff
changeset
|
309 | * Remove all pref callbacks by handle |
|
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10071
diff
changeset
|
310 | */ |
| 15884 | 311 | void purple_prefs_disconnect_by_handle(void *handle); |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10071
diff
changeset
|
312 | |
|
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10071
diff
changeset
|
313 | /** |
| 5684 | 314 | * Trigger callbacks as if the pref changed |
| 315 | */ | |
| 15884 | 316 | void purple_prefs_trigger_callback(const char *name); |
| 5684 | 317 | |
| 318 | /** | |
| 5441 | 319 | * Read preferences |
| 320 | */ | |
| 15884 | 321 | gboolean purple_prefs_load(void); |
| 5441 | 322 | |
| 323 | /** | |
|
8900
14f4b7ae958e
[gaim-migrate @ 9669]
Mark Doliner <markdoliner@pidgin.im>
parents:
8705
diff
changeset
|
324 | * Rename legacy prefs and delete some that no longer exist. |
|
14f4b7ae958e
[gaim-migrate @ 9669]
Mark Doliner <markdoliner@pidgin.im>
parents:
8705
diff
changeset
|
325 | */ |
| 15884 | 326 | void purple_prefs_update_old(void); |
|
8900
14f4b7ae958e
[gaim-migrate @ 9669]
Mark Doliner <markdoliner@pidgin.im>
parents:
8705
diff
changeset
|
327 | |
| 5441 | 328 | /*@}*/ |
| 329 | ||
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
330 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
331 | } |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
332 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
333 | |
| 15884 | 334 | #endif /* _PURPLE_PREFS_H_ */ |