support of fahrenheit option
[psensor.git] / src / cfg.h
1 /*
2  * Copyright (C) 2010-2012 jeanfi@gmail.com
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * 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., 51 Franklin Street, Fifth Floor, Boston, MA
17  * 02110-1301 USA
18  */
19 #ifndef _PSENSOR_CONFIG_H_
20 #define _PSENSOR_CONFIG_H_
21
22 #include "color.h"
23
24 enum temperature_unit {
25         CELCIUS,
26         FAHRENHEIT
27 };
28
29 enum sensorlist_position {
30         SENSORLIST_POSITION_RIGHT,
31         SENSORLIST_POSITION_LEFT,
32         SENSORLIST_POSITION_TOP,
33         SENSORLIST_POSITION_BOTTOM
34 };
35
36 struct config {
37         struct color *graph_bgcolor;
38         struct color *graph_fgcolor;
39
40         double graph_bg_alpha;
41
42         int alpha_channel_enabled;
43
44         /*
45            Position of the sensors list table
46          */
47         enum sensorlist_position sensorlist_position;
48
49         int window_decoration_enabled;
50         int window_keep_below_enabled;
51         int window_restore_enabled;
52         /* Last saved position of the window. */
53         int window_x;
54         int window_y;
55         /* Last saved size of the window. */
56         int window_w;
57         int window_h;
58         /* Last saved position of the window divider. */
59         int window_divider_pos;
60
61         int graph_update_interval;
62         int graph_monitoring_duration;
63
64         int sensor_values_max_length;
65         int sensor_update_interval;
66
67         int menu_bar_disabled;
68
69         int unity_launcher_count_disabled;
70
71         int hide_on_startup;
72
73         enum temperature_unit temperature_unit;
74 };
75
76 /*
77   Loads config from GConf
78 */
79 struct config *config_load();
80
81 void config_save(struct config *);
82
83 void config_init();
84
85 void config_cleanup();
86
87 struct color *config_get_sensor_color(char *, struct color *);
88 void config_set_sensor_color(char *, struct color *);
89
90 int config_get_sensor_alarm_limit(char *, int);
91 void config_set_sensor_alarm_limit(char *, int);
92
93 int config_get_sensor_alarm_enabled(char *);
94 void config_set_sensor_alarm_enabled(char *, int);
95
96 int config_is_sensor_enabled(char *);
97 void config_set_sensor_enabled(char *, int);
98
99 char *config_get_sensor_name(char *);
100 void config_set_sensor_name(char *, const char *);
101
102 #endif