Merge branch 'master' of https://vcs.maemo.org/git/gpssportsniffer
[gpssportsniffer] / settings.h
1 /****************************************************************************
2 **
3 **  Copyright (C) 2011  Tito Eritja Real <jtitoo@gmail.com>
4 **
5 **  This program is free software: you can redistribute it and/or modify
6 **  it under the terms of the GNU General Public License as published by
7 **  the Free Software Foundation, either version 3 of the License, or
8 **  (at your option) any later version.
9 **
10 **  This program is distributed in the hope that it will be useful,
11 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 **  GNU General Public License for more details.
14 **
15 **  You should have received a copy of the GNU General Public License
16 **  along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 **
18 ****************************************************************************/
19
20 #ifndef SETTINGS_H
21 #define SETTINGS_H
22
23 #include "log.h"
24
25 class Settings{
26
27 private:
28
29     QString activity;
30     int gpsInterval;
31     MapType mapType;
32     bool isOnline;
33     bool isCache;
34     QString xmlFile;
35     QString xmlType;
36     bool servicesStarted;
37     bool isConfigured;
38     int autosaveInterval;
39     int horizontalAccuracy;
40     int verticalAccuracy;
41     QString trackColor;
42     QString trackToSniffColor;
43     Log *log;
44
45 public:
46
47     explicit Settings(Log *log=0);
48     explicit Settings(const Settings&, Log *log=0);
49
50     inline QString getTrackColor(){return trackColor;}
51     inline void setTrackColor(QString color){trackColor=color;}
52
53     inline QString getTrackToSniffColor(){return trackToSniffColor;}
54     inline void setTrackToSniffColor(QString color){trackToSniffColor=color;}
55
56     inline bool getIsConfigured(){return isConfigured;}
57     inline void setIsConfigured(bool configured){isConfigured=configured;}
58
59     inline int getAutosaveInterval(){return autosaveInterval;}
60     inline void setAutosaveInterval(int interval){autosaveInterval=interval;}
61
62     inline QString getActivity(){return activity;}
63     inline void setActivity(QString activity){this->activity=activity;}
64
65     inline int getGpsInterval(){return gpsInterval;}
66     inline void setGpsInterval(int interval){this->gpsInterval=interval;}
67
68     inline MapType getMapType(){return mapType;}
69     inline void setMapType(MapType mapType){this->mapType=mapType;}
70
71     inline QString getXMLType(){return xmlType;}
72     inline void setXMLType(QString type){xmlType=type;}
73
74
75     inline bool getIsOnline(){return isOnline;}
76     inline void setIsOnline(bool isOnline){this->isOnline=isOnline;}
77
78     inline bool getIsCache(){return isCache;}
79     inline void setIsCache(bool isCache){this->isCache=isCache;}
80
81     inline bool areServicesStarted(){return servicesStarted;}
82     inline void setServicesStarted(bool st){this->servicesStarted=st;}
83
84     inline QString getXmlFile(){return xmlFile;}
85     inline void setXmlFile(QString xmlFile){this->xmlFile=xmlFile;}
86
87     inline int getHorizontalAccuracy(){return horizontalAccuracy;}
88     inline void setHorizontalAccuracy(int value){horizontalAccuracy=value;}
89
90     inline int getVerticalAccuracy(){return verticalAccuracy;}
91     inline void setVerticalAccuracy(int value){verticalAccuracy=value;}
92
93     QString toString();
94
95     Settings& operator= (const Settings&);
96
97     friend int operator== (const Settings&, const Settings&);
98     friend int operator!= (const Settings&, const Settings&);
99     friend QDataStream& operator<< (QDataStream&, const Settings&);
100
101
102 };
103
104
105 #endif // SETTINGS_H