Statistics
| Revision:

root / trunk / nntpgrab_core / configuration.h @ 1913

History | View | Annotate | Download (2.9 KB)

1
/* 
2
    Copyright (C) 2005-2010  Erik van Pienbroek
3

                
4
    This program is free software; you can redistribute it and/or modify
5
    it under the terms of the GNU General Public License as published by
6
    the Free Software Foundation; either version 2 of the License, or
7
    (at your option) any later version.
8

                
9
    This program is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
    GNU General Public License for more details.
13

                
14
    You should have received a copy of the GNU General Public License
15
    along with this program; if not, write to the Free Software
16
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
*/
18

                
19
#ifndef _CONFIGURATION_H_
20
#define _CONFIGURATION_H_
21

                
22
#include 
23
#include "nntpgrab.h"
24

                
25
typedef struct Configuration Configuration;
26

                
27
#define CONFIGURATION_TYPE_OBJECT       (configuration_get_type ())
28
#define CONFIGURATION(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), CONFIGURATION_TYPE_OBJECT, Configuration))
29
#define CONFIGURATION_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), CONFIGURATION_TYPE_OBJECT, ConfigurationClass))
30
#define IS_CONFIGURATION(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), CONFIGURATION_TYPE_OBJECT))
31
#define IS_CONFIGURATION_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), CONFIGURATION_TYPE_OBJECT))
32
#define CONFIGURATION_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), CONFIGURATION_TYPE_OBJECT, ConfigurationClass))
33

                
34
GType configuration_get_type (void);
35

                
36
Configuration   *configuration_new(char **errmsg, char **warnings);
37
void             configuration_destroy(Configuration *obj);
38

                
39
GList           *configuration_get_avail_servers(Configuration *obj);
40
void             configuration_free_avail_servers(Configuration *obj, GList *servers);
41
NGConfigServer  *configuration_get_server_info(Configuration *obj, const char *servername);
42
gboolean         configuration_add_server(Configuration *obj, NGConfigServer new_server, char **errmsg);
43
gboolean         configuration_del_server(Configuration *obj, const char *servername, char **errmsg);
44
gboolean         configuration_edit_server(Configuration *obj, const char *servername, NGConfigServer new_server, char **errmsg);
45
ConfigGroupInfo  configuration_get_newsgroup_info(Configuration *obj, const char *servername, const char *newsgroup);
46
void             configuration_set_newsgroup_info(Configuration *obj, const char *servername, const char *newsgroup, ConfigGroupInfo info);
47
NGConfigOpts     configuration_get_opts(Configuration *obj);
48
void             configuration_set_opts(Configuration *obj, NGConfigOpts opts);
49
char            *configuration_get_config_folder(void);
50
gboolean         configuration_load(Configuration *config, char **errmsg);
51
gboolean         configuration_save(Configuration *config, char **errmsg);
52

                
53
#endif /* _CONFIGURATION_H_ */