Version 0.6-2, use of cell+gps, fix "start daemon"
[googlelatitude] / src / gps.h
1 #ifndef GPS_H
2 #define GPS_H
3
4 #include <QtCore>
5 #include <QtNetwork>
6
7 #ifdef Q_WS_MAEMO_5
8 extern "C" {
9 #include <location/location-gps-device.h>
10 #include <location/location-gpsd-control.h>
11 }
12 #else
13 #include <QtNetwork>
14 #endif // Q_WS_MAEMO_5
15
16 class GpsMaemo5 : public QObject {
17     Q_OBJECT
18
19 signals:
20     void fix();
21
22 public:
23     GpsMaemo5(QObject *parent = 0);
24     double get_lat() { return latitude; }
25     double get_lon() { return longitude; }
26     double get_acc() { return accuracy; }
27
28 public slots:
29     void refresh();
30     void stop();
31     void forcestop();
32     int config(int i, int w, QString m);
33
34 private slots:
35 #ifdef Q_WS_MAEMO_5
36     friend void GpsMaemo5_changed(LocationGPSDevice *device, GpsMaemo5 *gps);
37 #else
38     void gloc_reply(QNetworkReply *r);
39 #endif // Q_WS_MAEMO_5
40
41 private:
42     double latitude;
43     double longitude;
44     double accuracy;
45     int interval;
46     int wait;
47     QString method;
48     bool emitfix;
49     bool stopgps;
50 #ifdef Q_WS_MAEMO_5
51     LocationGPSDControl *control;
52     LocationGPSDevice *device;
53 #else
54     QUrl urlloc;
55     QNetworkAccessManager *worker;
56 #endif // Q_WS_MAEMO_5
57 };
58
59 #ifdef Q_WS_MAEMO_5
60 void GpsMaemo5_changed(LocationGPSDevice *device, GpsMaemo5 *gps);
61 #endif // Q_WS_MAEMO_5
62
63 #endif // GPS_H