1 /* 2 * prefs.h: configuration management routines 3 * Copyright (C) 2002-2004 Saulius Menkevicius 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * 19 * $Id: prefs.h,v 1.21 2004/12/29 15:58:25 bobas Exp $ 20 */ 21 22 #ifndef PREFS_H__ 23 #define PREFS_H__ 24 25 /* preferences registered in the `prefs' module */ 26 #define PREFS_PREFS_AUTO_SAVE "prefs/auto_save" 27 28 enum prefs_type { 29 PREFS_TYPE_BOOL, 30 PREFS_TYPE_UINT, 31 PREFS_TYPE_STR, 32 PREFS_TYPE_LIST, 33 }; 34 35 void prefs_register_module(gint, gchar **, gchar **); 36 37 gboolean prefs_in_sync(); 38 39 typedef gboolean prefs_validator_func(const gchar *, gpointer); 40 void prefs_register( 41 const gchar *, enum prefs_type, const gchar *, 42 prefs_validator_func *, gpointer); 43 void prefs_add_notifier(const gchar *, GHookFunc); 44 45 const gchar * prefs_description(const gchar *); 46 47 void prefs_set(const gchar *, ...); 48 49 guint prefs_int(const gchar *); 50 gboolean prefs_bool(const gchar *); 51 const gchar * prefs_str(const gchar *); 52 GList * prefs_list(const gchar *); 53 void prefs_list_add(const gchar *, const gchar *); 54 void prefs_list_add_unique(const gchar *, const gchar *); 55 gboolean prefs_list_remove(const gchar *, const gchar *); 56 void prefs_list_clear(const gchar *); 57 gboolean prefs_list_contains(const gchar *, const gchar *); 58 59 #endif /* #ifndef PREFS_H__ */ 60 61