ver 4.6
[googlelatitude] / src / gps.h
1 #ifndef GPS_H
2 #define GPS_H
3
4 #include <QObject>
5
6 #ifdef Q_WS_MAEMO_5
7 extern "C" {
8 #include <location/location-gps-device.h>
9 #include <location/location-gpsd-control.h>
10 }
11 #else
12 #include <QtNetwork>
13 #include <QTimer>
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 #ifdef Q_WS_MAEMO_5
28     friend void GpsMaemo5_changed(LocationGPSDevice *device, GpsMaemo5 *gps);
29 #endif // Q_WS_MAEMO_5
30
31 #ifdef Q_WS_MAEMO_5
32 #else
33 private slots:
34     void finishedreply(QNetworkReply *r);
35     void gloc();
36 #endif // Q_WS_MAEMO_5
37
38 private:
39     double latitude;
40     double longitude;
41     double accuracy;
42 #ifdef Q_WS_MAEMO_5
43     GMainLoop *loop;
44     LocationGPSDControl *control;
45     LocationGPSDevice *device;
46 #else
47     QUrl urlloc;
48     QNetworkAccessManager *worker;
49 #endif // Q_WS_MAEMO_5
50
51 };
52
53 #ifdef Q_WS_MAEMO_5
54 void GpsMaemo5_changed(LocationGPSDevice *device, GpsMaemo5 *gps);
55 #endif // Q_WS_MAEMO_5
56
57 #endif // GPS_H