Mercurial > pidgin
annotate src/prefs.h @ 8900:7a67c459ab8f
[gaim-migrate @ 9669]
Move the preference renameing/removing stuff to prefs.c...
It's pretty ugly... but it was ugly before...
So now we remove the eradicated prefs. I think.
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Fri, 07 May 2004 03:25:00 +0000 |
| parents | 543b19a96ac5 |
| children | 5e78d07f6b36 |
| 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 */ | |
| 25 | |
| 26 #ifndef _PREFS_H_ | |
| 27 #define _PREFS_H_ | |
| 28 | |
|
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5561
diff
changeset
|
29 #include <glib.h> |
|
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5561
diff
changeset
|
30 |
| 5441 | 31 /** |
| 32 * Pref data types. | |
| 33 */ | |
| 34 typedef enum _GaimPrefType | |
| 35 { | |
| 36 GAIM_PREF_NONE, | |
| 37 GAIM_PREF_BOOLEAN, | |
| 38 GAIM_PREF_INT, | |
| 5561 | 39 GAIM_PREF_STRING, |
| 40 GAIM_PREF_STRING_LIST | |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
41 |
| 5441 | 42 } GaimPrefType; |
| 43 | |
| 44 /** | |
| 45 * Pref change callback type | |
| 46 */ | |
| 47 | |
| 48 typedef void (*GaimPrefCallback) (const char *name, GaimPrefType type, | |
| 49 gpointer val, gpointer data); | |
| 50 | |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
51 #ifdef __cplusplus |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
52 extern "C" { |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
53 #endif |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
54 |
| 5441 | 55 /**************************************************************************/ |
| 56 /** @name Prefs API */ | |
| 57 /**************************************************************************/ | |
| 58 /*@{*/ | |
| 59 | |
| 60 /** | |
| 61 * Initialize core prefs | |
| 62 */ | |
| 63 void gaim_prefs_init(); | |
| 64 | |
| 65 /** | |
| 8235 | 66 * Uninitializes the prefs subsystem. |
| 67 */ | |
| 68 void gaim_prefs_uninit(void); | |
| 69 | |
| 70 /** | |
| 5441 | 71 * Add a new typeless pref. |
| 72 * | |
| 73 * @param name The name of the pref | |
| 74 */ | |
| 75 void gaim_prefs_add_none(const char *name); | |
| 76 | |
| 77 /** | |
| 78 * Add a new boolean pref. | |
| 79 * | |
| 80 * @param name The name of the pref | |
| 81 * @param value The initial value to set | |
| 82 */ | |
| 83 void gaim_prefs_add_bool(const char *name, gboolean value); | |
| 84 | |
| 85 /** | |
| 86 * Add a new integer pref. | |
| 87 * | |
| 88 * @param name The name of the pref | |
| 89 * @param value The initial value to set | |
| 90 */ | |
| 91 void gaim_prefs_add_int(const char *name, int value); | |
| 92 | |
| 93 /** | |
| 94 * Add a new string pref. | |
| 95 * | |
| 96 * @param name The name of the pref | |
| 97 * @param value The initial value to set | |
| 98 */ | |
| 99 void gaim_prefs_add_string(const char *name, const char *value); | |
| 100 | |
| 101 /** | |
| 5561 | 102 * Add a new string list pref. |
| 103 * | |
| 104 * @param name The name of the pref | |
| 105 * @param value The initial value to set | |
| 106 */ | |
| 107 void gaim_prefs_add_string_list(const char *name, GList *value); | |
| 108 | |
| 109 /** | |
| 5441 | 110 * Remove a pref. |
| 111 * | |
| 112 * @param name The name of the pref | |
| 113 */ | |
| 114 void gaim_prefs_remove(const char *name); | |
| 115 | |
| 116 /** | |
| 6693 | 117 * Rename a pref |
| 118 * | |
| 119 * @param oldname The old name of the pref | |
| 120 * @param newname The new name for the pref | |
| 121 */ | |
| 122 void gaim_prefs_rename(const char *oldname, const char *newname); | |
| 123 | |
| 124 /** | |
| 8705 | 125 * Rename a boolean pref, toggling it's value |
| 126 * | |
| 127 * @param oldname The old name of the pref | |
| 128 * @param newname The new name for the pref | |
| 129 */ | |
| 130 void gaim_prefs_rename_boolean_toggle(const char *oldname, const char *newname); | |
| 131 | |
| 132 /** | |
| 5441 | 133 * Remove all prefs. |
| 134 */ | |
| 135 void gaim_prefs_destroy(); | |
| 136 | |
| 137 /** | |
| 138 * Set raw pref value | |
| 139 * | |
| 140 * @param name The name of the pref | |
| 141 * @param value The value to set | |
| 142 */ | |
| 143 void gaim_prefs_set_generic(const char *name, gpointer value); | |
| 144 | |
| 145 /** | |
| 146 * Set boolean pref value | |
| 147 * | |
| 148 * @param name The name of the pref | |
| 149 * @param value The value to set | |
| 150 */ | |
| 151 void gaim_prefs_set_bool(const char *name, gboolean value); | |
| 152 | |
| 153 /** | |
| 154 * Set integer pref value | |
| 155 * | |
| 156 * @param name The name of the pref | |
| 157 * @param value The value to set | |
| 158 */ | |
| 159 void gaim_prefs_set_int(const char *name, int value); | |
| 160 | |
| 161 /** | |
| 162 * Set string pref value | |
| 163 * | |
| 164 * @param name The name of the pref | |
| 165 * @param value The value to set | |
| 166 */ | |
| 5451 | 167 void gaim_prefs_set_string(const char *name, const char *value); |
| 5441 | 168 |
| 169 /** | |
| 5561 | 170 * Set string pref value |
| 171 * | |
| 172 * @param name The name of the pref | |
| 173 * @param value The value to set | |
| 174 */ | |
| 175 void gaim_prefs_set_string_list(const char *name, GList *value); | |
| 176 | |
| 177 /** | |
| 6538 | 178 * Get pref type |
| 179 * | |
| 180 * @param name The name of the pref | |
| 181 * @return The type of the pref | |
| 182 */ | |
| 183 GaimPrefType gaim_prefs_get_type(const char *name); | |
| 184 | |
| 185 /** | |
| 5441 | 186 * Get boolean pref value |
| 187 * | |
| 188 * @param name The name of the pref | |
| 189 * @return The value of the pref | |
| 190 */ | |
| 191 gboolean gaim_prefs_get_bool(const char *name); | |
| 192 | |
| 193 /** | |
| 194 * Get integer pref value | |
| 195 * | |
| 196 * @param name The name of the pref | |
| 197 * @return The value of the pref | |
| 198 */ | |
| 199 int gaim_prefs_get_int(const char *name); | |
| 200 | |
| 201 /** | |
| 202 * Get string pref value | |
| 203 * | |
| 204 * @param name The name of the pref | |
| 205 * @return The value of the pref | |
| 206 */ | |
|
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5534
diff
changeset
|
207 const char *gaim_prefs_get_string(const char *name); |
| 5441 | 208 |
| 209 /** | |
| 5561 | 210 * Get string pref value |
| 211 * | |
| 212 * @param name The name of the pref | |
| 213 * @return The value of the pref | |
| 214 */ | |
| 215 GList *gaim_prefs_get_string_list(const char *name); | |
| 216 | |
| 217 /** | |
| 5441 | 218 * Add a callback to a pref (and its children) |
| 219 */ | |
| 220 guint gaim_prefs_connect_callback(const char *name, GaimPrefCallback cb, | |
| 221 gpointer data); | |
| 222 | |
| 223 /** | |
| 224 * Remove a callback to a pref | |
| 225 */ | |
| 226 void gaim_prefs_disconnect_callback(guint callback_id); | |
| 227 | |
| 228 /** | |
| 5684 | 229 * Trigger callbacks as if the pref changed |
| 230 */ | |
| 231 void gaim_prefs_trigger_callback(const char *name); | |
| 232 | |
| 233 /** | |
| 5441 | 234 * Read preferences |
| 235 */ | |
|
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5534
diff
changeset
|
236 gboolean gaim_prefs_load(); |
| 5441 | 237 |
| 238 /** | |
| 239 * Force an immediate write of preferences | |
| 240 */ | |
| 241 void gaim_prefs_sync(); | |
| 242 | |
| 8900 | 243 /** |
| 244 * Rename legacy prefs and delete some that no longer exist. | |
| 245 */ | |
| 246 void gaim_prefs_update_old(); | |
| 247 | |
| 5441 | 248 /*@}*/ |
| 249 | |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
250 #ifdef __cplusplus |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
251 } |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
252 #endif |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
253 |
| 5441 | 254 #endif /* _PREFS_H_ */ |
