annotate src/prefs.h @ 12488:40fada5b3d59

[gaim-migrate @ 14800] return 0 when successful. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 15 Dec 2005 16:13:56 +0000
parents fc464a0abccc
children 8ae981f2c9cb
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
10066
2c8a9f9a71e6 [gaim-migrate @ 11041]
Mark Doliner <mark@kingant.net>
parents: 9713
diff changeset
3 * @ingroup core
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
4 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
5 * gaim
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
6 *
8046
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 6693
diff changeset
7 * 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
8 * 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
9 * source distribution.
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
10 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
12 * 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
13 * the Free Software Foundation; either version 2 of the License, or
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
14 * (at your option) any later version.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
15 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
19 * GNU General Public License for more details.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
20 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
24 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
25 */
9713
db62420a53a2 [gaim-migrate @ 10574]
Mark Doliner <mark@kingant.net>
parents: 9619
diff changeset
26 #ifndef _GAIM_PREFS_H_
db62420a53a2 [gaim-migrate @ 10574]
Mark Doliner <mark@kingant.net>
parents: 9619
diff changeset
27 #define _GAIM_PREFS_H_
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
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
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
31 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
32 * Pref data types.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
33 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
34 typedef enum _GaimPrefType
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
35 {
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
36 GAIM_PREF_NONE,
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
37 GAIM_PREF_BOOLEAN,
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
38 GAIM_PREF_INT,
5561
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
39 GAIM_PREF_STRING,
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
40 GAIM_PREF_STRING_LIST
5944
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
41
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
42 } GaimPrefType;
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 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
45 * Pref change callback type
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
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
48 typedef void (*GaimPrefCallback) (const char *name, GaimPrefType type,
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
49 gpointer val, gpointer data);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
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
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
55 /**************************************************************************/
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
56 /** @name Prefs API */
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 /**
10443
b6ca0e1b19d0 [gaim-migrate @ 11703]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
61 * Returns the prefs subsystem handle.
b6ca0e1b19d0 [gaim-migrate @ 11703]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
62 *
b6ca0e1b19d0 [gaim-migrate @ 11703]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
63 * @return The prefs subsystem handle.
b6ca0e1b19d0 [gaim-migrate @ 11703]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
64 */
b6ca0e1b19d0 [gaim-migrate @ 11703]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
65 void *gaim_prefs_get_handle(void);
b6ca0e1b19d0 [gaim-migrate @ 11703]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
66
b6ca0e1b19d0 [gaim-migrate @ 11703]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
67 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
68 * Initialize core prefs
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
69 */
12323
fc464a0abccc [gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents: 10443
diff changeset
70 void gaim_prefs_init(void);
5441
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 /**
8235
63c7a16a2c09 [gaim-migrate @ 8958]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
73 * Uninitializes the prefs subsystem.
63c7a16a2c09 [gaim-migrate @ 8958]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
74 */
63c7a16a2c09 [gaim-migrate @ 8958]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
75 void gaim_prefs_uninit(void);
63c7a16a2c09 [gaim-migrate @ 8958]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
76
63c7a16a2c09 [gaim-migrate @ 8958]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
77 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
78 * Add a new typeless pref.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
79 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
80 * @param name The name of the pref
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_none(const char *name);
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 boolean 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_bool(const char *name, gboolean 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 integer 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_int(const char *name, int 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 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
101 * Add a new string pref.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
102 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
103 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
104 * @param value The initial value to set
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
105 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
106 void gaim_prefs_add_string(const char *name, const char *value);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
107
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
108 /**
5561
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
109 * Add a new string list pref.
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
110 *
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
111 * @param name The name of the pref
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
112 * @param value The initial value to set
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
113 */
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
114 void gaim_prefs_add_string_list(const char *name, GList *value);
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
115
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
116 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
117 * Remove a pref.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
118 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
119 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
120 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
121 void gaim_prefs_remove(const char *name);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
122
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
123 /**
6693
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
124 * Rename a pref
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
125 *
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
126 * @param oldname The old name of the pref
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
127 * @param newname The new name for the pref
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
128 */
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
129 void gaim_prefs_rename(const char *oldname, const char *newname);
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
130
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
131 /**
8705
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
132 * Rename a boolean pref, toggling it's value
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
133 *
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
134 * @param oldname The old name of the pref
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
135 * @param newname The new name for the pref
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
136 */
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
137 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
138
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
139 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
140 * Remove all prefs.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
141 */
12323
fc464a0abccc [gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents: 10443
diff changeset
142 void gaim_prefs_destroy(void);
5441
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 raw 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_generic(const char *name, gpointer 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 boolean 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_bool(const char *name, gboolean 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 integer 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 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
166 void gaim_prefs_set_int(const char *name, int value);
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 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
169 * Set string pref value
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
170 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
171 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
172 * @param value The value to set
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
173 */
5451
e1cc0c67e123 [gaim-migrate @ 5839]
Nathan Walp <nwalp@pidgin.im>
parents: 5441
diff changeset
174 void gaim_prefs_set_string(const char *name, const char *value);
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
175
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
176 /**
5561
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
177 * Set string pref value
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
178 *
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
179 * @param name The name of the pref
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
180 * @param value The value to set
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
181 */
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
182 void gaim_prefs_set_string_list(const char *name, GList *value);
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
183
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
184 /**
9611
5e78d07f6b36 [gaim-migrate @ 10454]
Tim Ringenbach <marv@pidgin.im>
parents: 8900
diff changeset
185 * Check if a pref exists
5e78d07f6b36 [gaim-migrate @ 10454]
Tim Ringenbach <marv@pidgin.im>
parents: 8900
diff changeset
186 *
9619
da88e2cd5c53 [gaim-migrate @ 10463]
Mark Doliner <mark@kingant.net>
parents: 9611
diff changeset
187 * @param name The name of the pref
da88e2cd5c53 [gaim-migrate @ 10463]
Mark Doliner <mark@kingant.net>
parents: 9611
diff changeset
188 * @return TRUE if the pref exists. Otherwise FALSE.
9611
5e78d07f6b36 [gaim-migrate @ 10454]
Tim Ringenbach <marv@pidgin.im>
parents: 8900
diff changeset
189 */
5e78d07f6b36 [gaim-migrate @ 10454]
Tim Ringenbach <marv@pidgin.im>
parents: 8900
diff changeset
190 gboolean gaim_prefs_exists(const char *name);
5e78d07f6b36 [gaim-migrate @ 10454]
Tim Ringenbach <marv@pidgin.im>
parents: 8900
diff changeset
191
5e78d07f6b36 [gaim-migrate @ 10454]
Tim Ringenbach <marv@pidgin.im>
parents: 8900
diff changeset
192 /**
6538
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
193 * Get pref type
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
194 *
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
195 * @param name The name of the pref
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
196 * @return The type of the pref
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
197 */
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
198 GaimPrefType gaim_prefs_get_type(const char *name);
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
199
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
200 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
201 * Get boolean 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 gboolean gaim_prefs_get_bool(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 integer 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 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
214 int gaim_prefs_get_int(const char *name);
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 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
217 * Get string pref value
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
218 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
219 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
220 * @return The value of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
221 */
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5534
diff changeset
222 const char *gaim_prefs_get_string(const char *name);
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
223
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
224 /**
10071
af06746954de [gaim-migrate @ 11047]
Mark Doliner <mark@kingant.net>
parents: 10066
diff changeset
225 * Get string list pref value
5561
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
226 *
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
227 * @param name The name of the pref
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
228 * @return The value of the pref
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
229 */
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
230 GList *gaim_prefs_get_string_list(const char *name);
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
231
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
232 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
233 * Add a callback to a pref (and its children)
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
234 */
10087
9fdbfe832fac [gaim-migrate @ 11098]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10071
diff changeset
235 guint gaim_prefs_connect_callback(void *handle, const char *name, GaimPrefCallback cb,
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
236 gpointer data);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
237
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
238 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
239 * Remove a callback to a pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
240 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
241 void gaim_prefs_disconnect_callback(guint callback_id);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
242
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
243 /**
10087
9fdbfe832fac [gaim-migrate @ 11098]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10071
diff changeset
244 * Remove all pref callbacks by handle
9fdbfe832fac [gaim-migrate @ 11098]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10071
diff changeset
245 */
9fdbfe832fac [gaim-migrate @ 11098]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10071
diff changeset
246 void gaim_prefs_disconnect_by_handle(void *handle);
9fdbfe832fac [gaim-migrate @ 11098]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10071
diff changeset
247
9fdbfe832fac [gaim-migrate @ 11098]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10071
diff changeset
248 /**
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5638
diff changeset
249 * Trigger callbacks as if the pref changed
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5638
diff changeset
250 */
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5638
diff changeset
251 void gaim_prefs_trigger_callback(const char *name);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5638
diff changeset
252
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5638
diff changeset
253 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
254 * Read preferences
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
255 */
12323
fc464a0abccc [gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents: 10443
diff changeset
256 gboolean gaim_prefs_load(void);
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
257
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
258 /**
8900
7a67c459ab8f [gaim-migrate @ 9669]
Mark Doliner <mark@kingant.net>
parents: 8705
diff changeset
259 * Rename legacy prefs and delete some that no longer exist.
7a67c459ab8f [gaim-migrate @ 9669]
Mark Doliner <mark@kingant.net>
parents: 8705
diff changeset
260 */
12323
fc464a0abccc [gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents: 10443
diff changeset
261 void gaim_prefs_update_old(void);
8900
7a67c459ab8f [gaim-migrate @ 9669]
Mark Doliner <mark@kingant.net>
parents: 8705
diff changeset
262
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
263 /*@}*/
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
264
5944
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
265 #ifdef __cplusplus
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
266 }
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
267 #endif
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
268
9713
db62420a53a2 [gaim-migrate @ 10574]
Mark Doliner <mark@kingant.net>
parents: 9619
diff changeset
269 #endif /* _GAIM_PREFS_H_ */