LP-56 - Better txpid option namings, fix tabs-spaces, tooltips. headers, variable...
[librepilot.git] / ground / openpilotgcs / src / plugins / opmap / opmapgadgetconfiguration.h
blob8d0e1bbbe169b1c48895f3b0441d27daa43b663d
1 /**
2 ******************************************************************************
4 * @file opmapgadgetconfiguration.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
6 * @addtogroup GCSPlugins GCS Plugins
7 * @{
8 * @addtogroup OPMapPlugin OpenPilot Map Plugin
9 * @{
10 * @brief The OpenPilot Map plugin
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #ifndef OPMAP_GADGETCONFIGURATION_H
29 #define OPMAP_GADGETCONFIGURATION_H
31 #include <coreplugin/iuavgadgetconfiguration.h>
32 #include <QtCore/QString>
34 using namespace Core;
36 class OPMapGadgetConfiguration : public IUAVGadgetConfiguration {
37 Q_OBJECT Q_PROPERTY(QString mapProvider READ mapProvider WRITE setMapProvider)
38 Q_PROPERTY(int zoommo READ zoom WRITE setZoom)
39 Q_PROPERTY(double latitude READ latitude WRITE setLatitude)
40 Q_PROPERTY(double longitude READ longitude WRITE setLongitude)
41 Q_PROPERTY(bool useOpenGL READ useOpenGL WRITE setUseOpenGL)
42 Q_PROPERTY(bool showTileGridLines READ showTileGridLines WRITE setShowTileGridLines)
43 Q_PROPERTY(QString accessMode READ accessMode WRITE setAccessMode)
44 Q_PROPERTY(bool useMemoryCache READ useMemoryCache WRITE setUseMemoryCache)
45 Q_PROPERTY(QString cacheLocation READ cacheLocation WRITE setCacheLocation)
46 Q_PROPERTY(QString uavSymbol READ uavSymbol WRITE setUavSymbol)
47 Q_PROPERTY(int maxUpdateRate READ maxUpdateRate WRITE setMaxUpdateRate)
48 Q_PROPERTY(qreal overlayOpacity READ opacity WRITE setOpacity)
50 public:
51 explicit OPMapGadgetConfiguration(QString classId, QSettings *qSettings = 0, QObject *parent = 0);
53 void saveConfig(QSettings *settings) const;
54 IUAVGadgetConfiguration *clone();
56 QString mapProvider() const
58 return m_mapProvider;
60 int zoom() const
62 return m_defaultZoom;
64 double latitude() const
66 return m_defaultLatitude;
68 double longitude() const
70 return m_defaultLongitude;
72 bool useOpenGL() const
74 return m_useOpenGL;
76 bool showTileGridLines() const
78 return m_showTileGridLines;
80 QString accessMode() const
82 return m_accessMode;
84 bool useMemoryCache() const
86 return m_useMemoryCache;
88 QString cacheLocation() const
90 return m_cacheLocation;
92 QString uavSymbol() const
94 return m_uavSymbol;
96 int maxUpdateRate() const
98 return m_maxUpdateRate;
100 qreal opacity() const
102 return m_opacity;
104 void save() const;
105 public slots:
106 void setMapProvider(QString provider)
108 m_mapProvider = provider;
110 void setZoom(int zoom)
112 m_defaultZoom = zoom;
114 void setLatitude(double latitude)
116 m_defaultLatitude = latitude;
118 void setOpacity(qreal value)
120 m_opacity = value;
122 void setLongitude(double longitude)
124 m_defaultLongitude = longitude;
126 void setUseOpenGL(bool useOpenGL)
128 m_useOpenGL = useOpenGL;
130 void setShowTileGridLines(bool showTileGridLines)
132 m_showTileGridLines = showTileGridLines;
134 void setAccessMode(QString accessMode)
136 m_accessMode = accessMode;
138 void setUseMemoryCache(bool useMemoryCache)
140 m_useMemoryCache = useMemoryCache;
142 void setCacheLocation(QString cacheLocation);
143 void setUavSymbol(QString symbol)
145 m_uavSymbol = symbol;
147 void setMaxUpdateRate(int update_rate)
149 m_maxUpdateRate = update_rate;
152 private:
153 QString m_mapProvider;
154 int m_defaultZoom;
155 double m_defaultLatitude;
156 double m_defaultLongitude;
157 bool m_useOpenGL;
158 bool m_showTileGridLines;
159 QString m_accessMode;
160 bool m_useMemoryCache;
161 QString m_cacheLocation;
162 QString m_uavSymbol;
163 int m_maxUpdateRate;
164 QSettings *m_settings;
165 qreal m_opacity;
168 #endif // OPMAP_GADGETCONFIGURATION_H