1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ 2 /* 3 * Copyright (C) 2008 Imendio AB 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License as 7 * published by the Free Software Foundation; either version 2 of the 8 * License, or (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 GNU 13 * General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public 16 * License along with this program; if not, write to the 17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 * Boston, MA 02111-1307, USA. 19 */ 20 21 #ifndef __IGE_CONF_H__ 22 #define __IGE_CONF_H__ 23 24 #include <glib-object.h> 25 26 G_BEGIN_DECLS 27 28 #define IGE_TYPE_CONF (ige_conf_get_type ()) 29 #define IGE_CONF(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), IGE_TYPE_CONF, IgeConf)) 30 #define IGE_CONF_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), IGE_TYPE_CONF, IgeConfClass)) 31 #define IGE_IS_CONF(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), IGE_TYPE_CONF)) 32 #define IGE_IS_CONF_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), IGE_TYPE_CONF)) 33 #define IGE_CONF_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), IGE_TYPE_CONF, IgeConfClass)) 34 35 typedef struct _IgeConf IgeConf; 36 typedef struct _IgeConfClass IgeConfClass; 37 38 struct _IgeConf { 39 GObject parent_instance; 40 }; 41 42 struct _IgeConfClass { 43 GObjectClass parent_class; 44 }; 45 46 typedef void (*IgeConfNotifyFunc) (IgeConf *conf, 47 const gchar *key, 48 gpointer user_data); 49 50 GType ige_conf_get_type (void); 51 IgeConf *ige_conf_get (void); 52 void ige_conf_add_defaults (IgeConf *conf, 53 const gchar *path); 54 guint ige_conf_notify_add (IgeConf *conf, 55 const gchar *key, 56 IgeConfNotifyFunc func, 57 gpointer data); 58 gboolean ige_conf_notify_remove (IgeConf *conf, 59 guint id); 60 gboolean ige_conf_set_int (IgeConf *conf, 61 const gchar *key, 62 gint value); 63 gboolean ige_conf_get_int (IgeConf *conf, 64 const gchar *key, 65 gint *value); 66 gboolean ige_conf_set_bool (IgeConf *conf, 67 const gchar *key, 68 gboolean value); 69 gboolean ige_conf_get_bool (IgeConf *conf, 70 const gchar *key, 71 gboolean *value); 72 gboolean ige_conf_set_string (IgeConf *conf, 73 const gchar *key, 74 const gchar *value); 75 gboolean ige_conf_get_string (IgeConf *conf, 76 const gchar *key, 77 gchar **value); 78 gboolean ige_conf_set_string_list (IgeConf *conf, 79 const gchar *key, 80 GSList *value); 81 gboolean ige_conf_get_string_list (IgeConf *conf, 82 const gchar *key, 83 GSList **value); 84 85 G_END_DECLS 86 87 #endif /* __IGE_CONF_H__ */ 88