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 
00189 void purple_prefs_set_generic(const char *name, gpointer value);
00190 
00197 void purple_prefs_set_bool(const char *name, gboolean value);
00198 
00205 void purple_prefs_set_int(const char *name, int value);
00206 
00213 void purple_prefs_set_string(const char *name, const char *value);
00214 
00221 void purple_prefs_set_string_list(const char *name, GList *value);
00222 
00229 void purple_prefs_set_path(const char *name, const char *value);
00230 
00237 void purple_prefs_set_path_list(const char *name, GList *value);
00238 
00239 
00246 gboolean purple_prefs_exists(const char *name);
00247 
00254 PurplePrefType purple_prefs_get_type(const char *name);
00255 
00262 gboolean purple_prefs_get_bool(const char *name);
00263 
00270 int purple_prefs_get_int(const char *name);
00271 
00278 const char *purple_prefs_get_string(const char *name);
00279 
00286 GList *purple_prefs_get_string_list(const char *name);
00287 
00294 const char *purple_prefs_get_path(const char *name);
00295 
00302 GList *purple_prefs_get_path_list(const char *name);
00303 
00314 GList *purple_prefs_get_children_names(const char *name);
00315 
00319 guint purple_prefs_connect_callback(void *handle, const char *name, PurplePrefCallback cb,
00320         gpointer data);
00321 
00325 void purple_prefs_disconnect_callback(guint callback_id);
00326 
00330 void purple_prefs_disconnect_by_handle(void *handle);
00331 
00335 void purple_prefs_trigger_callback(const char *name);
00336 
00340 gboolean purple_prefs_load(void);
00341 
00345 void purple_prefs_update_old(void);
00346 
00349 #ifdef __cplusplus
00350 }
00351 #endif
00352 
00353 #endif /* _PURPLE_PREFS_H_ */