]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - common/configuration.h
Load all users only when really needed
[sojka/lightdm.git] / common / configuration.h
1 /*
2  * Copyright (C) 2010-2011 Robert Ancell.
3  * Author: Robert Ancell <robert.ancell@canonical.com>
4  * 
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
9  * license.
10  */
11
12 #ifndef CONFIGURATION_H_
13 #define CONFIGURATION_H_
14
15 #include <glib-object.h>
16
17 G_BEGIN_DECLS
18
19 #define CONFIGURATION_TYPE (config_get_type())
20 #define CONFIGURATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONFIGURATION_TYPE, Configuration));
21
22 typedef struct ConfigurationPrivate ConfigurationPrivate;
23
24 typedef struct
25 {
26     GObject             parent_instance;
27     ConfigurationPrivate *priv;
28 } Configuration;
29
30 typedef struct
31 {
32     GObjectClass parent_class;
33 } ConfigurationClass;
34
35 GType config_get_type (void);
36
37 Configuration *config_get_instance (void);
38
39 gboolean config_load_from_file (Configuration *config, const gchar *path, GList **messages, GError **error);
40
41 gboolean config_load_from_standard_locations (Configuration *config, const gchar *config_path, GList **messages);
42
43 const gchar *config_get_directory (Configuration *config);
44
45 gchar **config_get_groups (Configuration *config);
46
47 gchar **config_get_keys (Configuration *config, const gchar *group_name);
48
49 gboolean config_has_key (Configuration *config, const gchar *section, const gchar *key);
50
51 GList *config_get_sources (Configuration *config);
52
53 const gchar *config_get_source (Configuration *config, const gchar *section, const gchar *key);
54
55 void config_set_string (Configuration *config, const gchar *section, const gchar *key, const gchar *value);
56
57 gchar *config_get_string (Configuration *config, const gchar *section, const gchar *key);
58
59 void config_set_string_list (Configuration *config, const gchar *section, const gchar *key, const gchar **value, gsize length);
60
61 gchar **config_get_string_list (Configuration *config, const gchar *section, const gchar *key);
62
63 void config_set_integer (Configuration *config, const gchar *section, const gchar *key, gint value);
64
65 gint config_get_integer (Configuration *config, const gchar *section, const gchar *key);
66
67 void config_set_boolean (Configuration *config, const gchar *section, const gchar *key, gboolean value);
68
69 gboolean config_get_boolean (Configuration *config, const gchar *section, const gchar *key);
70
71 G_END_DECLS
72
73 #endif /* CONFIGURATION_H_ */