Display section of settings.
[yandex-traffic] / settings.hpp
1 #ifndef __SETTINGS_H__
2 #define __SETTINGS_H__
3
4 #include <QtCore>
5
6
7 class Settings : public QObject
8 {
9     Q_OBJECT
10 public:
11     enum check_t {
12         C_Light = 0,
13         C_Rank,
14         C_Time,
15         C_Hint,
16         C_TotalCount
17     };
18
19 private:
20     QString _regionID;          // region ID which will be displayed
21     QMap<QString, QString> _cities;
22     bool _checks[C_TotalCount];
23
24     void makeDefault ();
25
26 public:
27     Settings ();
28
29     bool load ();
30     bool save ();
31
32     QString regionID () const
33     { return _regionID; };
34
35     QMap<QString, QString> cities () const
36     { return _cities; };
37
38     bool check (check_t entry) const
39     { return _checks[entry]; };
40 };
41
42
43 #endif // __SETTINGS_H__