Merge branch 'nikosmaster'
[ptas] /
1 #ifndef GPSCONTROLLER_H
2 #define GPSCONTROLLER_H
3
4 #include "logic/location.h"
5
6 #include <QObject>
7 #include <QGeoPositionInfo>
8 #include <QGeoPositionInfoSource>
9
10 QTM_USE_NAMESPACE;
11
12 class Location;
13
14 class GpsController : public QObject
15 {
16     Q_OBJECT
17
18 public:
19     GpsController(bool started = true);
20
21     ~GpsController();
22
23     QGeoPositionInfoSource *gps() const;
24     bool                    isStarted() const;
25
26 public Q_SLOTS:
27     void useGPS( bool );
28
29 Q_SIGNALS:
30     void gpsLocationChanged( Location *newLocation );
31
32 private Q_SLOTS:
33     void updateLocation( QGeoPositionInfo positionInfo );
34     void timeoutRequested();
35
36 private:
37     QGeoPositionInfoSource *m_gps;
38     bool                    m_started;
39 };
40
41 #endif // GPSCONTROLLER_H