4 * @file gmyth/gmyth_settings.h
6 * @brief <p> This component contains functions acessing and modifying
7 * user and program settings.
9 * The standard settings file is created in the user home folder, in the
10 * file ~/.mmyth/settings.dat.
12 * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
13 * @author Alexsandro Jose Virginio dos Santos <alexsandro.santos@indt.org.br>
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU Lesser General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU Lesser General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 #ifndef __GMYTH_SETTINGS_H__
33 #define __GMYTH_SETTINGS_H__
35 #include <glib-object.h>
39 #define GMYTH_SETTINGS_TYPE (gmyth_settings_get_type ())
40 #define GMYTH_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_SETTINGS_TYPE, GMythSettings))
41 #define GMYTH_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_SETTINGS_TYPE, GMythSettingsClass))
42 #define IS_GMYTH_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_SETTINGS_TYPE))
43 #define IS_GMYTH_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_SETTINGS_TYPE))
44 #define GMYTH_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_SETTINGS_TYPE, GMythSettingsClass))
47 typedef struct _GMythSettings GMythSettings;
48 typedef struct _GMythSettingsClass GMythSettingsClass;
50 struct _GMythSettingsClass
52 GObjectClass parent_class;
62 GString *settings_file;
64 GString *backend_hostname;
67 GString *mysql_dbname;
68 GString *mysql_username;
69 GString *mysql_password;
70 // FIXME: Why do we need database_type? Do we intend to support other dbs?
71 GString *database_type;
75 GType gmyth_settings_get_type (void);
77 GMythSettings* gmyth_settings_new (void);
79 gboolean gmyth_settings_load_from_file (GMythSettings *gmyth_settings,
81 gboolean gmyth_settings_load (GMythSettings *msettings);
82 gboolean gmyth_settings_save (GMythSettings *gmyth_settings);
84 GString* gmyth_settings_get_backend_hostname (GMythSettings *gmyth_settings);
85 void gmyth_settings_set_backend_hostname (GMythSettings *gmyth_settings,
86 GString *new_hostname);
88 GString* gmyth_settings_get_username (GMythSettings *gmyth_settings);
89 void gmyth_settings_set_username (GMythSettings *gmyth_settings,
90 GString *new_username);
92 GString* gmyth_settings_get_password (GMythSettings *gmyth_settings);
93 void gmyth_settings_set_password (GMythSettings *gmyth_settings,
94 GString *new_password);
96 GString* gmyth_settings_get_dbname (GMythSettings *gmyth_settings);
97 void gmyth_settings_set_dbname (GMythSettings *gmyth_settings,
100 int gmyth_settings_get_backend_port (GMythSettings *gmyth_settings);
101 void gmyth_settings_set_backend_port (GMythSettings *gmyth_settings,
106 #endif /* __GMYTH_SETTINGS_H__ */