1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
2  *
3  * Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  */
20 
21 
22 #ifndef __GDM_SETTINGS_UTILS_H
23 #define __GDM_SETTINGS_UTILS_H
24 
25 #include <glib-object.h>
26 
27 G_BEGIN_DECLS
28 
29 typedef struct _GdmSettingsEntry GdmSettingsEntry;
30 
31 GdmSettingsEntry *        gdm_settings_entry_new               (void);
32 GdmSettingsEntry *        gdm_settings_entry_copy              (GdmSettingsEntry *entry);
33 void                      gdm_settings_entry_free              (GdmSettingsEntry *entry);
34 
35 const char *              gdm_settings_entry_get_key           (GdmSettingsEntry *entry);
36 const char *              gdm_settings_entry_get_signature     (GdmSettingsEntry *entry);
37 const char *              gdm_settings_entry_get_default_value (GdmSettingsEntry *entry);
38 const char *              gdm_settings_entry_get_value         (GdmSettingsEntry *entry);
39 
40 void                      gdm_settings_entry_set_value         (GdmSettingsEntry *entry,
41                                                                 const char       *value);
42 
43 gboolean                  gdm_settings_parse_schemas           (const char  *file,
44                                                                 const char  *root,
45                                                                 GSList     **list);
46 
47 gboolean                  gdm_settings_parse_value_as_boolean  (const char *value,
48                                                                 gboolean   *bool);
49 gboolean                  gdm_settings_parse_value_as_integer  (const char *value,
50                                                                 int        *intval);
51 gboolean                  gdm_settings_parse_value_as_double   (const char *value,
52                                                                 gdouble    *doubleval);
53 
54 char *                    gdm_settings_parse_boolean_as_value  (gboolean    boolval);
55 char *                    gdm_settings_parse_integer_as_value  (int         intval);
56 char *                    gdm_settings_parse_double_as_value   (gdouble     doubleval);
57 
58 
59 G_END_DECLS
60 
61 #endif /* __GDM_SETTINGS_UTILS_H */
62