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 | {
|
---|
27 | Q_OBJECT
|
---|
28 |
|
---|
29 | public:
|
---|
30 | Map(Layout* parent,int row, int col,QString name,QList<QtMobility::QGeoCoordinate> coordinates,bool enabled,int period);
|
---|
31 | ~Map();
|
---|
32 | void setCenteredPoint(int i);
|
---|
33 | int centeredPoint(void);
|
---|
34 | bool isCentered(void);
|
---|
35 |
|
---|
36 | private:
|
---|
37 | MapWidget *mapWidget;
|
---|
38 | QtMobility::QGeoMappingManager *manager;
|
---|
39 | QList<QtMobility::QGeoMappingManager *> managers;
|
---|
40 | QtMobility::QGraphicsGeoMap *geoMap;
|
---|
41 | QtMobility::QGeoServiceProvider *service;
|
---|
42 | QComboBox *mapTypeCombo,*serviceCombo,*proxyCombo;
|
---|
43 | QHash<QtMobility::QGraphicsGeoMap::MapType, QString> mapTypes;
|
---|
44 | QToolButton *zoomin,*zoomout;
|
---|
45 | QAction *zoomInAction;
|
---|
46 | QAction *zoomOutAction;
|
---|
47 | QList<Landmark*> points;
|
---|
48 | int centeredpoint;
|
---|
49 |
|
---|
50 | bool findServices(void);
|
---|
51 | void findproxy(void);
|
---|
52 | void populateMapTypeCombo();
|
---|
53 | bool IsUptodate(void);
|
---|
54 | void SetUptodate(void);
|
---|
55 | void Reset(void);
|
---|
56 | void XmlEvent(QDomElement dom);
|
---|
57 | void BufEvent(char** buf,int *buf_size,uint16_t period,bool big_endian);
|
---|
58 |
|
---|
59 | void RemovePoints(void);
|
---|
60 | void AddPoints(QtMobility::QGraphicsGeoMap *geoMap);
|
---|
61 |
|
---|
62 | private slots:
|
---|
63 | void changeMapType(int index);
|
---|
64 | void selectService(int index);
|
---|
65 | void changeproxy(int index);
|
---|
66 | void updateZoom(qreal value);
|
---|
67 | void zoomIn(void);
|
---|
68 | void zoomOut(void);
|
---|
69 |
|
---|
70 | };
|
---|
71 |
|
---|
72 | #endif // MAP_H
|
---|