prefs.h

Go to the documentation of this file.
00001 
00006 /* purple
00007  *
00008  * Purple is the legal property of its developers, whose names are too numerous
00009  * to list here.  Please refer to the COPYRIGHT file distributed with this
00010  * source distribution.
00011  *
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU General Public License as published by
00014  * the Free Software Foundation; either version 2 of the License, or
00015  * (at your option) any later version.
00016  *
00017  * This program is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU General Public License
00023  * along with this program; if not, write to the Free Software
00024  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
00025  *
00026  */
00027 #ifndef _PURPLE_PREFS_H_
00028 #define _PURPLE_PREFS_H_
00029 
00030 #include <glib.h>
00031 
00035 typedef enum _PurplePrefType
00036 {
00037     PURPLE_PREF_NONE,        
00038     PURPLE_PREF_BOOLEAN,     
00039     PURPLE_PREF_INT,         
00040     PURPLE_PREF_STRING,      
00041     PURPLE_PREF_STRING_LIST, 
00042     PURPLE_PREF_PATH,        
00043     PURPLE_PREF_PATH_LIST    
00045 } PurplePrefType;
00046 
00062 typedef void (*PurplePrefCallback) (const char *name, PurplePrefType type,
00063         gconstpointer val, gpointer data);
00064 
00065 #ifdef __cplusplus
00066 extern "C" {
00067 #endif
00068 
00069 /**************************************************************************/
00073 /**************************************************************************/
00081 void *purple_prefs_get_handle(void);
00082 
00086 void purple_prefs_init(void);
00087 
00091 void purple_prefs_uninit(void);
00092 
00098 void purple_prefs_add_none(const char *name);
00099 
00106 void purple_prefs_add_bool(const char *name, gboolean value);
00107 
00114 void purple_prefs_add_int(const char *name, int value);
00115 
00122 void purple_prefs_add_string(const char *name, const char *value);
00123 
00133 void purple_prefs_add_string_list(const char *name, GList *value);
00134 
00141 void purple_prefs_add_path(const char *name, const char *value);
00142 
00152 void purple_prefs_add_path_list(const char *name, GList *value);
00153 
00154 
00160 void purple_prefs_remove(const char *name);
00161 
00168 void purple_prefs_rename(const char *oldname, const char *newname);
00169 
00176 void purple_prefs_rename_boolean_toggle(const char *oldname, const char *newname);
00177 
00181 void purple_prefs_destroy(void);
00182 
00197 /* TODO: When this is removed, also remove struct purple_pref->value.generic */
00198 void purple_prefs_set_generic(const char *name, gpointer value);
00199 
00206 void purple_prefs_set_bool(const char *name, gboolean value);
00207 
00214 void purple_prefs_set_int(const char *name, int value);
00215 
00222 void purple_prefs_set_string(const char *name, const char *value);
00223 
00230 void purple_prefs_set_string_list(const char *name, GList *value);
00231 
00238 void purple_prefs_set_path(const char *name, const char *value);
00239 
00246 void purple_prefs_set_path_list(const char *name, GList *value);
00247 
00248 
00255 gboolean purple_prefs_exists(const char *name);
00256 
00263 PurplePrefType purple_prefs_get_type(const char *name);
00264 
00271 gboolean purple_prefs_get_bool(const char *name);
00272 
00279 int purple_prefs_get_int(const char *name);
00280 
00287 const char *purple_prefs_get_string(const char *name);
00288 
00295 GList *purple_prefs_get_string_list(const char *name);
00296 
00303 const char *purple_prefs_get_path(const char *name);
00304 
00311 GList *purple_prefs_get_path_list(const char *name);
00312 
00323 GList *purple_prefs_get_children_names(const char *name);
00324 
00337 guint purple_prefs_connect_callback(void *handle, const char *name, PurplePrefCallback cb,
00338         gpointer data);
00339 
00343 void purple_prefs_disconnect_callback(guint callback_id);
00344 
00348 void purple_prefs_disconnect_by_handle(void *handle);
00349 
00353 void purple_prefs_trigger_callback(const char *name);
00354 
00358 gboolean purple_prefs_load(void);
00359 
00363 void purple_prefs_update_old(void);
00364 
00367 #ifdef __cplusplus
00368 }
00369 #endif
00370 
00371 #endif /* _PURPLE_PREFS_H_ */