Mercurial > pidgin
annotate src/prefs.h @ 5615:6500a6c8d679
[gaim-migrate @ 6022]
Checkboxes update!
committer: Tailor Script <tailor@pidgin.im>
| author | Christian Hammond <chipx86@chipx86.com> |
|---|---|
| date | Sat, 31 May 2003 18:35:22 +0000 |
| parents | d67b5b4e1323 |
| children | 0bdfa28c678e |
| rev | line source |
|---|---|
| 5441 | 1 /** |
| 2 * @file prefs.h Prefs API | |
| 3 * | |
| 4 * gaim | |
| 5 * | |
| 6 * Copyright (C) 2003, Nathan Walp <faceprint@faceprint.com> | |
| 7 * | |
| 8 * This program is free software; you can redistribute it and/or modify | |
| 9 * it under the terms of the GNU General Public License as published by | |
| 10 * the Free Software Foundation; either version 2 of the License, or | |
| 11 * (at your option) any later version. | |
| 12 * | |
| 13 * This program is distributed in the hope that it will be useful, | |
| 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 * GNU General Public License for more details. | |
| 17 * | |
| 18 * You should have received a copy of the GNU General Public License | |
| 19 * along with this program; if not, write to the Free Software | |
| 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 21 * | |
| 22 */ | |
| 23 | |
| 24 #ifndef _PREFS_H_ | |
| 25 #define _PREFS_H_ | |
| 26 | |
| 27 /** | |
| 28 * Pref data types. | |
| 29 */ | |
| 30 typedef enum _GaimPrefType | |
| 31 { | |
| 32 GAIM_PREF_NONE, | |
| 33 GAIM_PREF_BOOLEAN, | |
| 34 GAIM_PREF_INT, | |
| 5561 | 35 GAIM_PREF_STRING, |
| 36 GAIM_PREF_STRING_LIST | |
| 5441 | 37 } GaimPrefType; |
| 38 | |
| 39 /** | |
| 40 * Pref change callback type | |
| 41 */ | |
| 42 | |
| 43 typedef void (*GaimPrefCallback) (const char *name, GaimPrefType type, | |
| 44 gpointer val, gpointer data); | |
| 45 | |
| 46 /**************************************************************************/ | |
| 47 /** @name Prefs API */ | |
| 48 /**************************************************************************/ | |
| 49 /*@{*/ | |
| 50 | |
| 51 /** | |
| 52 * Initialize core prefs | |
| 53 */ | |
| 54 void gaim_prefs_init(); | |
| 55 | |
| 56 /** | |
| 57 * Add a new typeless pref. | |
| 58 * | |
| 59 * @param name The name of the pref | |
| 60 */ | |
| 61 void gaim_prefs_add_none(const char *name); | |
| 62 | |
| 63 /** | |
| 64 * Add a new boolean pref. | |
| 65 * | |
| 66 * @param name The name of the pref | |
| 67 * @param value The initial value to set | |
| 68 */ | |
| 69 void gaim_prefs_add_bool(const char *name, gboolean value); | |
| 70 | |
| 71 /** | |
| 72 * Add a new integer pref. | |
| 73 * | |
| 74 * @param name The name of the pref | |
| 75 * @param value The initial value to set | |
| 76 */ | |
| 77 void gaim_prefs_add_int(const char *name, int value); | |
| 78 | |
| 79 /** | |
| 80 * Add a new string pref. | |
| 81 * | |
| 82 * @param name The name of the pref | |
| 83 * @param value The initial value to set | |
| 84 */ | |
| 85 void gaim_prefs_add_string(const char *name, const char *value); | |
| 86 | |
| 87 /** | |
| 5561 | 88 * Add a new string list pref. |
| 89 * | |
| 90 * @param name The name of the pref | |
| 91 * @param value The initial value to set | |
| 92 */ | |
| 93 void gaim_prefs_add_string_list(const char *name, GList *value); | |
| 94 | |
| 95 /** | |
| 5441 | 96 * Remove a pref. |
| 97 * | |
| 98 * @param name The name of the pref | |
| 99 */ | |
| 100 void gaim_prefs_remove(const char *name); | |
| 101 | |
| 102 /** | |
| 103 * Remove all prefs. | |
| 104 */ | |
| 105 void gaim_prefs_destroy(); | |
| 106 | |
| 107 /** | |
| 108 * Set raw pref value | |
| 109 * | |
| 110 * @param name The name of the pref | |
| 111 * @param value The value to set | |
| 112 */ | |
| 113 void gaim_prefs_set_generic(const char *name, gpointer value); | |
| 114 | |
| 115 /** | |
| 116 * Set boolean pref value | |
| 117 * | |
| 118 * @param name The name of the pref | |
| 119 * @param value The value to set | |
| 120 */ | |
| 121 void gaim_prefs_set_bool(const char *name, gboolean value); | |
| 122 | |
| 123 /** | |
| 124 * Set integer pref value | |
| 125 * | |
| 126 * @param name The name of the pref | |
| 127 * @param value The value to set | |
| 128 */ | |
| 129 void gaim_prefs_set_int(const char *name, int value); | |
| 130 | |
| 131 /** | |
| 132 * Set string pref value | |
| 133 * | |
| 134 * @param name The name of the pref | |
| 135 * @param value The value to set | |
| 136 */ | |
| 5451 | 137 void gaim_prefs_set_string(const char *name, const char *value); |
| 5441 | 138 |
| 139 /** | |
| 5561 | 140 * Set string pref value |
| 141 * | |
| 142 * @param name The name of the pref | |
| 143 * @param value The value to set | |
| 144 */ | |
| 145 void gaim_prefs_set_string_list(const char *name, GList *value); | |
| 146 | |
| 147 /** | |
| 5441 | 148 * Get boolean pref value |
| 149 * | |
| 150 * @param name The name of the pref | |
| 151 * @return The value of the pref | |
| 152 */ | |
| 153 gboolean gaim_prefs_get_bool(const char *name); | |
| 154 | |
| 155 /** | |
| 156 * Get integer pref value | |
| 157 * | |
| 158 * @param name The name of the pref | |
| 159 * @return The value of the pref | |
| 160 */ | |
| 161 int gaim_prefs_get_int(const char *name); | |
| 162 | |
| 163 /** | |
| 164 * Get string pref value | |
| 165 * | |
| 166 * @param name The name of the pref | |
| 167 * @return The value of the pref | |
| 168 */ | |
|
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5534
diff
changeset
|
169 const char *gaim_prefs_get_string(const char *name); |
| 5441 | 170 |
| 171 /** | |
| 5561 | 172 * Get string pref value |
| 173 * | |
| 174 * @param name The name of the pref | |
| 175 * @return The value of the pref | |
| 176 */ | |
| 177 GList *gaim_prefs_get_string_list(const char *name); | |
| 178 | |
| 179 /** | |
| 5441 | 180 * Add a callback to a pref (and its children) |
| 181 */ | |
| 182 guint gaim_prefs_connect_callback(const char *name, GaimPrefCallback cb, | |
| 183 gpointer data); | |
| 184 | |
| 185 /** | |
| 186 * Remove a callback to a pref | |
| 187 */ | |
| 188 void gaim_prefs_disconnect_callback(guint callback_id); | |
| 189 | |
| 190 /** | |
| 191 * Read preferences | |
| 192 */ | |
|
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5534
diff
changeset
|
193 gboolean gaim_prefs_load(); |
| 5441 | 194 |
| 195 /** | |
| 196 * Force an immediate write of preferences | |
| 197 */ | |
| 198 void gaim_prefs_sync(); | |
| 199 | |
| 200 /*@}*/ | |
| 201 | |
| 202 #endif /* _PREFS_H_ */ |
