2 * Copyright (C) 2010-2011 Robert Ancell.
3 * Author: Robert Ancell <robert.ancell@canonical.com>
5 * This program is free software: you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option) any later
8 * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
12 #ifndef CONFIGURATION_H_
13 #define CONFIGURATION_H_
15 #include <glib-object.h>
19 #define CONFIGURATION_TYPE (config_get_type())
20 #define CONFIGURATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONFIGURATION_TYPE, Configuration));
22 typedef struct ConfigurationPrivate ConfigurationPrivate;
26 GObject parent_instance;
27 ConfigurationPrivate *priv;
32 GObjectClass parent_class;
35 GType config_get_type (void);
37 Configuration *config_get_instance (void);
39 gboolean config_load_from_file (Configuration *config, const gchar *path, GError **error);
41 gchar **config_get_groups (Configuration *config);
43 gchar **config_get_keys (Configuration *config, const gchar *group_name);
45 gboolean config_has_key (Configuration *config, const gchar *section, const gchar *key);
47 void config_set_string (Configuration *config, const gchar *section, const gchar *key, const gchar *value);
49 gchar *config_get_string (Configuration *config, const gchar *section, const gchar *key);
51 void config_set_integer (Configuration *config, const gchar *section, const gchar *key, gint value);
53 gint config_get_integer (Configuration *config, const gchar *section, const gchar *key);
55 void config_set_boolean (Configuration *config, const gchar *section, const gchar *key, gboolean value);
57 gboolean config_get_boolean (Configuration *config, const gchar *section, const gchar *key);
61 #endif /* CONFIGURATION_H_ */