Back to index

lightdm  1.3.2
configuration.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2010-2011 Robert Ancell.
00003  * Author: Robert Ancell <robert.ancell@canonical.com>
00004  * 
00005  * This program is free software: you can redistribute it and/or modify it under
00006  * the terms of the GNU General Public License as published by the Free Software
00007  * Foundation, either version 3 of the License, or (at your option) any later
00008  * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
00009  * license.
00010  */
00011 
00012 #ifndef _CONFIGURATION_H_
00013 #define _CONFIGURATION_H_
00014 
00015 #include <glib-object.h>
00016 
00017 G_BEGIN_DECLS
00018 
00019 #define CONFIGURATION_TYPE (config_get_type())
00020 #define CONFIGURATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONFIGURATION_TYPE, Configuration));
00021 
00022 typedef struct ConfigurationPrivate ConfigurationPrivate;
00023 
00024 typedef struct
00025 {
00026     GObject             parent_instance;
00027     ConfigurationPrivate *priv;
00028 } Configuration;
00029 
00030 typedef struct
00031 {
00032     GObjectClass parent_class;
00033 } ConfigurationClass;
00034 
00035 GType config_get_type (void);
00036 
00037 Configuration *config_get_instance (void);
00038 
00039 gboolean config_load_from_file (Configuration *config, const gchar *path, GError **error);
00040 
00041 gchar **config_get_groups (Configuration *config);
00042 
00043 gchar **config_get_keys (Configuration *config, const gchar *group_name);
00044 
00045 gboolean config_has_key (Configuration *config, const gchar *section, const gchar *key);
00046 
00047 void config_set_string (Configuration *config, const gchar *section, const gchar *key, const gchar *value);
00048 
00049 gchar *config_get_string (Configuration *config, const gchar *section, const gchar *key);
00050 
00051 void config_set_integer (Configuration *config, const gchar *section, const gchar *key, gint value);
00052 
00053 gint config_get_integer (Configuration *config, const gchar *section, const gchar *key);
00054 
00055 void config_set_boolean (Configuration *config, const gchar *section, const gchar *key, gboolean value);
00056 
00057 gboolean config_get_boolean (Configuration *config, const gchar *section, const gchar *key);
00058 
00059 G_END_DECLS
00060 
00061 #endif /* _CONFIGURATION_H_ */