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