[324] | 1 | // %flair:license{
|
---|
| 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
| 4 | // %flair:license}
|
---|
| 5 | #ifndef MAP_H
|
---|
| 6 | #define MAP_H
|
---|
| 7 |
|
---|
| 8 | #include <stdint.h>
|
---|
| 9 | #include "DataRemote.h"
|
---|
| 10 | #include <QGeoCoordinate>
|
---|
| 11 | #include <QGraphicsGeoMap>
|
---|
| 12 |
|
---|
| 13 | class Layout;
|
---|
| 14 | class MapWidget;
|
---|
| 15 | class QComboBox;
|
---|
| 16 | class Landmark;
|
---|
| 17 | class QToolButton;
|
---|
| 18 |
|
---|
| 19 | namespace QtMobility {
|
---|
| 20 | class QGeoMappingManager;
|
---|
| 21 | class QGraphicsGeoMap;
|
---|
| 22 | class QGeoServiceProvider;
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | class Map : public DataRemote {
|
---|
| 26 | Q_OBJECT
|
---|
| 27 |
|
---|
| 28 | friend class MapWidget;
|
---|
| 29 |
|
---|
| 30 | public:
|
---|
| 31 | Map(Layout *parent, int row, int col, QString name,
|
---|
| 32 | QList<QtMobility::QGeoCoordinate> coordinates, bool enabled, int period);
|
---|
| 33 | ~Map();
|
---|
| 34 | void setCenteredPoint(int i);
|
---|
| 35 | int centeredPoint(void);
|
---|
| 36 | bool isCentered(void);
|
---|
| 37 |
|
---|
| 38 | private:
|
---|
| 39 | MapWidget *mapWidget;
|
---|
| 40 | QtMobility::QGeoMappingManager *manager;
|
---|
| 41 | QList<QtMobility::QGeoMappingManager *> managers;
|
---|
| 42 | QtMobility::QGraphicsGeoMap *geoMap;
|
---|
| 43 | QtMobility::QGeoServiceProvider *service;
|
---|
| 44 | QComboBox *mapTypeCombo, *serviceCombo, *proxyCombo;
|
---|
| 45 | QHash<QtMobility::QGraphicsGeoMap::MapType, QString> mapTypes;
|
---|
| 46 | QToolButton *zoomin, *zoomout;
|
---|
| 47 | QAction *zoomInAction;
|
---|
| 48 | QAction *zoomOutAction;
|
---|
| 49 | QList<Landmark *> points;
|
---|
| 50 | int centeredpoint;
|
---|
| 51 |
|
---|
| 52 | bool findServices(void);
|
---|
| 53 | void findproxy(void);
|
---|
| 54 | void populateMapTypeCombo();
|
---|
| 55 | bool IsUptodate(void);
|
---|
| 56 | void SetUptodate(void);
|
---|
| 57 | void Reset(void);
|
---|
| 58 | void XmlEvent(QDomElement *dom);
|
---|
| 59 | void BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian);
|
---|
| 60 |
|
---|
| 61 | void RemovePoints(void);
|
---|
| 62 | void AddPoints(QtMobility::QGraphicsGeoMap *geoMap);
|
---|
| 63 |
|
---|
| 64 | private slots:
|
---|
| 65 | void changeMapType(int index);
|
---|
| 66 | void selectService(int index);
|
---|
| 67 | void changeproxy(int index);
|
---|
| 68 | void updateZoom(qreal value);
|
---|
| 69 | void zoomIn(void);
|
---|
| 70 | void zoomOut(void);
|
---|
| 71 | };
|
---|
| 72 |
|
---|
| 73 | #endif // MAP_H
|
---|