leo_sobral@1
|
1 |
/**
|
leo_sobral@1
|
2 |
* GMyth Library
|
leo_sobral@1
|
3 |
*
|
leo_sobral@1
|
4 |
* @file gmyth/gmyth_settings.h
|
leo_sobral@1
|
5 |
*
|
leo_sobral@1
|
6 |
* @brief <p> This component contains functions acessing and modifying
|
leo_sobral@1
|
7 |
* user and program settings.
|
leo_sobral@1
|
8 |
*
|
leo_sobral@1
|
9 |
* The standard settings file is created in the user home folder, in the
|
leo_sobral@1
|
10 |
* file ~/.mmyth/settings.dat.
|
leo_sobral@1
|
11 |
*
|
leo_sobral@1
|
12 |
* Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
|
leo_sobral@1
|
13 |
* @author Alexsandro Jose Virginio dos Santos <alexsandro.santos@indt.org.br>
|
leo_sobral@1
|
14 |
*
|
leo_sobral@1
|
15 |
*//*
|
leo_sobral@1
|
16 |
*
|
leo_sobral@1
|
17 |
* This program is free software; you can redistribute it and/or modify
|
leo_sobral@1
|
18 |
* it under the terms of the GNU Lesser General Public License as published by
|
leo_sobral@1
|
19 |
* the Free Software Foundation; either version 2 of the License, or
|
leo_sobral@1
|
20 |
* (at your option) any later version.
|
leo_sobral@1
|
21 |
*
|
leo_sobral@1
|
22 |
* This program is distributed in the hope that it will be useful,
|
leo_sobral@1
|
23 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
leo_sobral@1
|
24 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
leo_sobral@1
|
25 |
* GNU General Public License for more details.
|
leo_sobral@1
|
26 |
*
|
leo_sobral@1
|
27 |
* You should have received a copy of the GNU Lesser General Public License
|
leo_sobral@1
|
28 |
* along with this program; if not, write to the Free Software
|
leo_sobral@1
|
29 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
leo_sobral@1
|
30 |
*/
|
leo_sobral@1
|
31 |
|
leo_sobral@1
|
32 |
#ifndef __GMYTH_SETTINGS_H__
|
leo_sobral@1
|
33 |
#define __GMYTH_SETTINGS_H__
|
leo_sobral@1
|
34 |
|
leo_sobral@1
|
35 |
#include <glib-object.h>
|
leo_sobral@1
|
36 |
|
leo_sobral@6
|
37 |
G_BEGIN_DECLS
|
leo_sobral@1
|
38 |
|
leo_sobral@1
|
39 |
#define GMYTH_SETTINGS_TYPE (gmyth_settings_get_type ())
|
leo_sobral@1
|
40 |
#define GMYTH_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_SETTINGS_TYPE, GMythSettings))
|
leo_sobral@1
|
41 |
#define GMYTH_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_SETTINGS_TYPE, GMythSettingsClass))
|
leo_sobral@1
|
42 |
#define IS_GMYTH_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_SETTINGS_TYPE))
|
leo_sobral@1
|
43 |
#define IS_GMYTH_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_SETTINGS_TYPE))
|
leo_sobral@1
|
44 |
#define GMYTH_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_SETTINGS_TYPE, GMythSettingsClass))
|
leo_sobral@1
|
45 |
|
leo_sobral@1
|
46 |
|
leo_sobral@1
|
47 |
typedef struct _GMythSettings GMythSettings;
|
leo_sobral@1
|
48 |
typedef struct _GMythSettingsClass GMythSettingsClass;
|
leo_sobral@1
|
49 |
|
leo_sobral@1
|
50 |
struct _GMythSettingsClass
|
leo_sobral@1
|
51 |
{
|
leo_sobral@1
|
52 |
GObjectClass parent_class;
|
leo_sobral@1
|
53 |
|
leo_sobral@1
|
54 |
/* callbacks */
|
leo_sobral@1
|
55 |
/* no one for now */
|
leo_sobral@1
|
56 |
};
|
leo_sobral@1
|
57 |
|
leo_sobral@1
|
58 |
struct _GMythSettings
|
leo_sobral@1
|
59 |
{
|
leo_sobral@1
|
60 |
GObject parent;
|
leo_sobral@1
|
61 |
|
leo_sobral@1
|
62 |
GString *settings_file;
|
leo_sobral@1
|
63 |
|
leo_sobral@1
|
64 |
GString *backend_hostname;
|
leo_sobral@1
|
65 |
int backend_port;
|
leo_sobral@1
|
66 |
|
leo_sobral@1
|
67 |
GString *mysql_dbname;
|
leo_sobral@1
|
68 |
GString *mysql_username;
|
leo_sobral@1
|
69 |
GString *mysql_password;
|
leo_sobral@1
|
70 |
// FIXME: Why do we need database_type? Do we intend to support other dbs?
|
leo_sobral@1
|
71 |
GString *database_type;
|
leo_sobral@1
|
72 |
};
|
leo_sobral@1
|
73 |
|
leo_sobral@1
|
74 |
|
leo_sobral@1
|
75 |
GType gmyth_settings_get_type (void);
|
leo_sobral@1
|
76 |
|
leo_sobral@6
|
77 |
GMythSettings* gmyth_settings_new (void);
|
leo_sobral@32
|
78 |
|
leo_sobral@32
|
79 |
gboolean gmyth_settings_load_from_file (GMythSettings *gmyth_settings,
|
leo_sobral@32
|
80 |
GString *filename);
|
leo_sobral@1
|
81 |
gboolean gmyth_settings_load (GMythSettings *msettings);
|
leo_sobral@1
|
82 |
gboolean gmyth_settings_save (GMythSettings *gmyth_settings);
|
leo_sobral@1
|
83 |
|
leo_sobral@1
|
84 |
GString* gmyth_settings_get_backend_hostname (GMythSettings *gmyth_settings);
|
leo_sobral@32
|
85 |
void gmyth_settings_set_backend_hostname (GMythSettings *gmyth_settings,
|
leo_sobral@32
|
86 |
GString *new_hostname);
|
leo_sobral@32
|
87 |
|
leo_sobral@1
|
88 |
GString* gmyth_settings_get_username (GMythSettings *gmyth_settings);
|
leo_sobral@32
|
89 |
void gmyth_settings_set_username (GMythSettings *gmyth_settings,
|
leo_sobral@32
|
90 |
GString *new_username);
|
leo_sobral@32
|
91 |
|
leo_sobral@1
|
92 |
GString* gmyth_settings_get_password (GMythSettings *gmyth_settings);
|
leo_sobral@32
|
93 |
void gmyth_settings_set_password (GMythSettings *gmyth_settings,
|
leo_sobral@32
|
94 |
GString *new_password);
|
leo_sobral@32
|
95 |
|
leo_sobral@1
|
96 |
GString* gmyth_settings_get_dbname (GMythSettings *gmyth_settings);
|
leo_sobral@32
|
97 |
void gmyth_settings_set_dbname (GMythSettings *gmyth_settings,
|
leo_sobral@32
|
98 |
GString *new_dbname);
|
leo_sobral@1
|
99 |
|
leo_sobral@32
|
100 |
int gmyth_settings_get_backend_port (GMythSettings *gmyth_settings);
|
leo_sobral@32
|
101 |
void gmyth_settings_set_backend_port (GMythSettings *gmyth_settings,
|
leo_sobral@32
|
102 |
gint new_port);
|
leo_sobral@1
|
103 |
|
leo_sobral@6
|
104 |
G_END_DECLS
|
leo_sobral@1
|
105 |
|
leo_sobral@1
|
106 |
#endif /* __GMYTH_SETTINGS_H__ */
|