42d8841a11e416cb434b96ef2379fccbe25bbce7
[googlelatitude] / src / gps.h
1 #ifndef GPS_H
2 #define GPS_H
3
4 #ifdef Q_WS_MAEMO_5
5
6 extern "C" {
7 #include <location/location-gps-device.h>
8 #include <location/location-gpsd-control.h>
9 }
10 #include <QObject>
11
12 class GpsMaemo5 : public QObject {
13     Q_OBJECT
14
15 signals:
16     void getOK();
17     void getOK_acwp();
18     void getOK_agnss();
19
20 public slots:
21     void get_acwp();
22     void get_agnss();
23
24 public:
25     GpsMaemo5(QObject *parent = 0);
26     double get_lat() { return latitude; }
27     double get_lon() { return longitude; }
28     double get_acc() { return accuracy; }
29     void stop();
30     void restart();
31     friend void GpsMaemo5_changed(LocationGPSDevice *device, GpsMaemo5 *gps);
32
33 private:
34     double latitude;
35     double longitude;
36     double accuracy;
37
38     int usegps;
39
40     GMainLoop *loop;
41     LocationGPSDControl *control;
42     LocationGPSDevice *device;
43
44 };
45
46 void GpsMaemo5_changed(LocationGPSDevice *device, GpsMaemo5 *gps);
47
48 #else
49 #include "gpsfake.h"
50 #endif
51
52 #endif // GPS_H