ifdef for maemo
[googlelatitude] / src / gps.h
index 3cf513a..2d9cfdf 100644 (file)
--- a/src/gps.h
+++ b/src/gps.h
@@ -3,29 +3,53 @@
 
 #include <QObject>
 
-class gps : public QObject {
+#ifdef Q_WS_MAEMO_5
+
+extern "C" {
+#include <location/location-gps-device.h>
+#include <location/location-gpsd-control.h>
+}
+
+class GpsMaemo5 : public QObject {
     Q_OBJECT
 
 signals:
-    void getOK();
-
-public slots:
-    void get();
+    void fix();
 
 public:
-    gps(QObject *parent = 0);
+    GpsMaemo5(QObject *parent = 0);
     double get_lat() { return latitude; }
     double get_lon() { return longitude; }
     double get_acc() { return accuracy; }
-    void set_acwp();
-    void set_agnss();
-    void start();
-    void stop();
+    friend void GpsMaemo5_changed(LocationGPSDevice *device, GpsMaemo5 *gps);
 
 private:
     double latitude;
     double longitude;
     double accuracy;
+
+    GMainLoop *loop;
+    LocationGPSDControl *control;
+    LocationGPSDevice *device;
+};
+
+void GpsMaemo5_changed(LocationGPSDevice *device, GpsMaemo5 *gps);
+
+#else // Q_WS_MAEMO_5
+
+class GpsMaemo5 : public QObject {
+    Q_OBJECT
+
+signals:
+    void fix();
+
+public:
+    GpsMaemo5(QObject *parent = 0) { Q_UNUSED(parent); }
+    double get_lat() { return 0; }
+    double get_lon() { return 0; }
+    double get_acc() { return 0; }
 };
 
+#endif // Q_WS_MAEMO_5
+
 #endif // GPS_H