Remove continuous_mode config option from Fremantle UI
[browser-switch] / config.h
1 /*
2  * config.h -- definitions for Browser Switchboard configuration
3  *
4  * Copyright (C) 2009-2010 Steven Luo
5  * Derived from a Python implementation by Jason Simpson and Steven Luo
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
20  * USA.
21  */
22
23 #ifndef _CONFIG_H
24 #define _CONFIG_H
25
26 #define SWB_CONFIG_INITIALIZED                  0x01
27 #define SWB_CONFIG_CONTINUOUS_MODE_SET          0x02
28 #define SWB_CONFIG_DEFAULT_BROWSER_SET          0x04
29 #define SWB_CONFIG_OTHER_BROWSER_CMD_SET        0x08
30 #define SWB_CONFIG_LOGGING_SET                  0x10
31
32 struct swb_config {
33         unsigned int flags;
34         /* Array of pointers to the elements of the struct, in the order given
35            in swb_config_options[] */
36         void *entries[4];
37
38         int continuous_mode;
39         char *default_browser;
40         char *other_browser_cmd;
41         char *logging;
42 };
43
44 struct swb_config_option {
45         char *name;
46         enum {
47                 SWB_CONFIG_OPT_STRING,
48                 SWB_CONFIG_OPT_INT
49         } type;
50         int set_mask;
51 };
52
53 void swb_config_copy(struct swb_config *dst, struct swb_config *src);
54 void swb_config_init(struct swb_config *cfg);
55 void swb_config_free(struct swb_config *cfg);
56
57 int swb_config_load(struct swb_config *cfg);
58
59 int swb_config_save(struct swb_config *cfg);
60
61 #endif /* _CONFIG_H */