[10] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[10] | 4 | // %flair:license}
|
---|
[9] | 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 {
|
---|
[15] | 20 | class QGeoMappingManager;
|
---|
| 21 | class QGraphicsGeoMap;
|
---|
| 22 | class QGeoServiceProvider;
|
---|
[9] | 23 | }
|
---|
| 24 |
|
---|
[15] | 25 | class Map : public DataRemote {
|
---|
| 26 | Q_OBJECT
|
---|
[9] | 27 |
|
---|
[67] | 28 | friend class MapWidget;
|
---|
| 29 |
|
---|
[15] | 30 | public:
|
---|
| 31 | Map(Layout *parent, int row, int col, QString name,
|
---|
[437] | 32 | QList<QtMobility::QGeoCoordinate> coordinates, bool enabled, uint16_t period);
|
---|
[15] | 33 | ~Map();
|
---|
| 34 | void setCenteredPoint(int i);
|
---|
| 35 | int centeredPoint(void);
|
---|
| 36 | bool isCentered(void);
|
---|
[9] | 37 |
|
---|
[15] | 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;
|
---|
[9] | 51 |
|
---|
[15] | 52 | bool findServices(void);
|
---|
| 53 | void findproxy(void);
|
---|
| 54 | void populateMapTypeCombo();
|
---|
| 55 | bool IsUptodate(void);
|
---|
| 56 | void SetUptodate(void);
|
---|
| 57 | void Reset(void);
|
---|
[269] | 58 | void XmlEvent(QDomElement *dom);
|
---|
[444] | 59 | void BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering,bool big_endian);
|
---|
[9] | 60 |
|
---|
[15] | 61 | void RemovePoints(void);
|
---|
| 62 | void AddPoints(QtMobility::QGraphicsGeoMap *geoMap);
|
---|
[9] | 63 |
|
---|
[15] | 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);
|
---|
[9] | 71 | };
|
---|
| 72 |
|
---|
| 73 | #endif // MAP_H
|
---|