annotate src/prefs.h @ 12732:7648dce3e356

[gaim-migrate @ 15076] Add available/away/invisible/offline menu items to the docklet context menu, and move all the status stuff into a submenu. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 05 Jan 2006 05:18:58 +0000
parents 8ae981f2c9cb
children ff267281e882
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 /**
12712
8ae981f2c9cb [gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents: 12323
diff changeset
32 * String format for preferences.
8ae981f2c9cb [gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents: 12323
diff changeset
33 */
8ae981f2c9cb [gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents: 12323
diff changeset
34 typedef enum
8ae981f2c9cb [gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents: 12323
diff changeset
35 {
8ae981f2c9cb [gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents: 12323
diff changeset
36 GAIM_STRING_FORMAT_TYPE_NONE = 0,
8ae981f2c9cb [gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents: 12323
diff changeset
37 GAIM_STRING_FORMAT_TYPE_MULTILINE = 1 << 0,
8ae981f2c9cb [gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents: 12323
diff changeset
38 GAIM_STRING_FORMAT_TYPE_HTML = 1 << 1
8ae981f2c9cb [gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents: 12323
diff changeset
39 } GaimStringFormatType;
8ae981f2c9cb [gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents: 12323
diff changeset
40
8ae981f2c9cb [gaim-migrate @ 15056]
Richard Laager <rlaager@wiktel.com>
parents: 12323
diff changeset
41 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
42 * Pref data types.
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 typedef enum _GaimPrefType
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
45 {
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
46 GAIM_PREF_NONE,
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
47 GAIM_PREF_BOOLEAN,
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
48 GAIM_PREF_INT,
5561
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
49 GAIM_PREF_STRING,
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
50 GAIM_PREF_STRING_LIST
5944
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
51
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
52 } GaimPrefType;
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
53
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
54 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
55 * Pref change callback type
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
56 */
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 typedef void (*GaimPrefCallback) (const char *name, GaimPrefType type,
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
59 gpointer val, gpointer data);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
60
5944
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
61 #ifdef __cplusplus
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
62 extern "C" {
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
63 #endif
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
64
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
65 /**************************************************************************/
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
66 /** @name Prefs API */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
67 /**************************************************************************/
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
68 /*@{*/
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
69
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
70 /**
10443
b6ca0e1b19d0 [gaim-migrate @ 11703]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
71 * Returns the prefs subsystem handle.
b6ca0e1b19d0 [gaim-migrate @ 11703]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
72 *
b6ca0e1b19d0 [gaim-migrate @ 11703]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
73 * @return The prefs subsystem handle.
b6ca0e1b19d0 [gaim-migrate @ 11703]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
74 */
b6ca0e1b19d0 [gaim-migrate @ 11703]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
75 void *gaim_prefs_get_handle(void);
b6ca0e1b19d0 [gaim-migrate @ 11703]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
76
b6ca0e1b19d0 [gaim-migrate @ 11703]
Mark Doliner <mark@kingant.net>
parents: 10087
diff changeset
77 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
78 * Initialize core prefs
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
79 */
12323
fc464a0abccc [gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents: 10443
diff changeset
80 void gaim_prefs_init(void);
5441
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 /**
8235
63c7a16a2c09 [gaim-migrate @ 8958]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
83 * Uninitializes the prefs subsystem.
63c7a16a2c09 [gaim-migrate @ 8958]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
84 */
63c7a16a2c09 [gaim-migrate @ 8958]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
85 void gaim_prefs_uninit(void);
63c7a16a2c09 [gaim-migrate @ 8958]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
86
63c7a16a2c09 [gaim-migrate @ 8958]
Mark Doliner <mark@kingant.net>
parents: 8046
diff changeset
87 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
88 * Add a new typeless pref.
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 * @param name The name of the pref
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 void gaim_prefs_add_none(const char *name);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
93
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 * Add a new boolean pref.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
96 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
97 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
98 * @param value The initial value to set
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 void gaim_prefs_add_bool(const char *name, gboolean value);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
101
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 * Add a new integer pref.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
104 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
105 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
106 * @param value The initial value to set
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 void gaim_prefs_add_int(const char *name, int value);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
109
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
110 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
111 * Add a new string pref.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
112 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
113 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
114 * @param value The initial value to set
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
115 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
116 void gaim_prefs_add_string(const char *name, const char *value);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
117
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
118 /**
5561
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
119 * Add a new string list pref.
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
120 *
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
121 * @param name The name of the pref
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
122 * @param value The initial value to set
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
123 */
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
124 void gaim_prefs_add_string_list(const char *name, GList *value);
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
125
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
126 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
127 * Remove a pref.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
128 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
129 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
130 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
131 void gaim_prefs_remove(const char *name);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
132
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
133 /**
6693
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
134 * Rename a pref
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
135 *
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
136 * @param oldname The old name of the pref
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
137 * @param newname The new name for the pref
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
138 */
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
139 void gaim_prefs_rename(const char *oldname, const char *newname);
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
140
8c1b5dd87fbf [gaim-migrate @ 7219]
Nathan Walp <nwalp@pidgin.im>
parents: 6538
diff changeset
141 /**
8705
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
142 * Rename a boolean pref, toggling it's value
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
143 *
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
144 * @param oldname The old name of the pref
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
145 * @param newname The new name for the pref
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
146 */
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
147 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
148
543b19a96ac5 [gaim-migrate @ 9458]
Luke Schierer <lschiere@pidgin.im>
parents: 8235
diff changeset
149 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
150 * Remove all prefs.
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
151 */
12323
fc464a0abccc [gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents: 10443
diff changeset
152 void gaim_prefs_destroy(void);
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
153
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 * Set raw pref value
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
156 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
157 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
158 * @param value The value to set
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 void gaim_prefs_set_generic(const char *name, gpointer value);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
161
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 * Set boolean pref value
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
164 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
165 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
166 * @param value The value to set
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 void gaim_prefs_set_bool(const char *name, gboolean value);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
169
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 * Set integer pref value
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
172 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
173 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
174 * @param value The value to set
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 void gaim_prefs_set_int(const char *name, int value);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
177
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
178 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
179 * Set string pref value
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
180 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
181 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
182 * @param value The value to set
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
183 */
5451
e1cc0c67e123 [gaim-migrate @ 5839]
Nathan Walp <nwalp@pidgin.im>
parents: 5441
diff changeset
184 void gaim_prefs_set_string(const char *name, const char *value);
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
185
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
186 /**
5561
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
187 * Set string pref value
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
188 *
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
189 * @param name The name of the pref
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
190 * @param value The value to set
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
191 */
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
192 void gaim_prefs_set_string_list(const char *name, GList *value);
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
193
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
194 /**
9611
5e78d07f6b36 [gaim-migrate @ 10454]
Tim Ringenbach <marv@pidgin.im>
parents: 8900
diff changeset
195 * Check if a pref exists
5e78d07f6b36 [gaim-migrate @ 10454]
Tim Ringenbach <marv@pidgin.im>
parents: 8900
diff changeset
196 *
9619
da88e2cd5c53 [gaim-migrate @ 10463]
Mark Doliner <mark@kingant.net>
parents: 9611
diff changeset
197 * @param name The name of the pref
da88e2cd5c53 [gaim-migrate @ 10463]
Mark Doliner <mark@kingant.net>
parents: 9611
diff changeset
198 * @return TRUE if the pref exists. Otherwise FALSE.
9611
5e78d07f6b36 [gaim-migrate @ 10454]
Tim Ringenbach <marv@pidgin.im>
parents: 8900
diff changeset
199 */
5e78d07f6b36 [gaim-migrate @ 10454]
Tim Ringenbach <marv@pidgin.im>
parents: 8900
diff changeset
200 gboolean gaim_prefs_exists(const char *name);
5e78d07f6b36 [gaim-migrate @ 10454]
Tim Ringenbach <marv@pidgin.im>
parents: 8900
diff changeset
201
5e78d07f6b36 [gaim-migrate @ 10454]
Tim Ringenbach <marv@pidgin.im>
parents: 8900
diff changeset
202 /**
6538
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
203 * Get pref type
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
204 *
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
205 * @param name The name of the pref
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
206 * @return The type of the pref
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
207 */
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
208 GaimPrefType gaim_prefs_get_type(const char *name);
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
209
4bc050b1af34 [gaim-migrate @ 7056]
Ethan Blanton <elb@pidgin.im>
parents: 5944
diff changeset
210 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
211 * Get boolean pref value
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
212 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
213 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
214 * @return The value of the pref
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 gboolean gaim_prefs_get_bool(const char *name);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
217
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 * Get integer pref value
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
220 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
221 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
222 * @return The value of the pref
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 int gaim_prefs_get_int(const char *name);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
225
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
226 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
227 * Get string pref value
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
228 *
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
229 * @param name The name of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
230 * @return The value of the pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
231 */
5545
7a64114641c3 [gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents: 5534
diff changeset
232 const char *gaim_prefs_get_string(const char *name);
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
233
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
234 /**
10071
af06746954de [gaim-migrate @ 11047]
Mark Doliner <mark@kingant.net>
parents: 10066
diff changeset
235 * Get string list pref value
5561
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
236 *
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
237 * @param name The name of the pref
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
238 * @return The value of the pref
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
239 */
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
240 GList *gaim_prefs_get_string_list(const char *name);
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
241
d67b5b4e1323 [gaim-migrate @ 5962]
Nathan Walp <nwalp@pidgin.im>
parents: 5545
diff changeset
242 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
243 * Add a callback to a pref (and its children)
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
244 */
10087
9fdbfe832fac [gaim-migrate @ 11098]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10071
diff changeset
245 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
246 gpointer data);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
247
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
248 /**
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
249 * Remove a callback to a pref
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
250 */
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
251 void gaim_prefs_disconnect_callback(guint callback_id);
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
252
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
253 /**
10087
9fdbfe832fac [gaim-migrate @ 11098]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10071
diff changeset
254 * Remove all pref callbacks by handle
9fdbfe832fac [gaim-migrate @ 11098]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10071
diff changeset
255 */
9fdbfe832fac [gaim-migrate @ 11098]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10071
diff changeset
256 void gaim_prefs_disconnect_by_handle(void *handle);
9fdbfe832fac [gaim-migrate @ 11098]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10071
diff changeset
257
9fdbfe832fac [gaim-migrate @ 11098]
Stu Tomlinson <stu@nosnilmot.com>
parents: 10071
diff changeset
258 /**
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5638
diff changeset
259 * Trigger callbacks as if the pref changed
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5638
diff changeset
260 */
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5638
diff changeset
261 void gaim_prefs_trigger_callback(const char *name);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5638
diff changeset
262
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5638
diff changeset
263 /**
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
264 * Read preferences
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
265 */
12323
fc464a0abccc [gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents: 10443
diff changeset
266 gboolean gaim_prefs_load(void);
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
267
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
268 /**
8900
7a67c459ab8f [gaim-migrate @ 9669]
Mark Doliner <mark@kingant.net>
parents: 8705
diff changeset
269 * Rename legacy prefs and delete some that no longer exist.
7a67c459ab8f [gaim-migrate @ 9669]
Mark Doliner <mark@kingant.net>
parents: 8705
diff changeset
270 */
12323
fc464a0abccc [gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents: 10443
diff changeset
271 void gaim_prefs_update_old(void);
8900
7a67c459ab8f [gaim-migrate @ 9669]
Mark Doliner <mark@kingant.net>
parents: 8705
diff changeset
272
5441
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
273 /*@}*/
e150a0cf4d6e [gaim-migrate @ 5823]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
274
5944
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
275 #ifdef __cplusplus
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
276 }
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
277 #endif
158196b2db19 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
278
9713
db62420a53a2 [gaim-migrate @ 10574]
Mark Doliner <mark@kingant.net>
parents: 9619
diff changeset
279 #endif /* _GAIM_PREFS_H_ */