X-Git-Url: http://git.maemo.org/git/?p=googlelatitude;a=blobdiff_plain;f=src%2Fgps.h;h=c0ba709e88c73f0c8caf5719fdd06364387e199f;hp=2d9cfdf8651e3fbcab10a54d86c8168533e8813a;hb=f66076c2991b0519cde383b2d09167333d55f5d6;hpb=26b02985c72432ad0927b4f69656106423d1ab58 diff --git a/src/gps.h b/src/gps.h index 2d9cfdf..c0ba709 100644 --- a/src/gps.h +++ b/src/gps.h @@ -1,14 +1,17 @@ #ifndef GPS_H #define GPS_H -#include +#include +#include #ifdef Q_WS_MAEMO_5 - extern "C" { #include #include } +#else +#include +#endif // Q_WS_MAEMO_5 class GpsMaemo5 : public QObject { Q_OBJECT @@ -21,35 +24,40 @@ public: double get_lat() { return latitude; } double get_lon() { return longitude; } double get_acc() { return accuracy; } + +public slots: + void refresh(); + void stop(); + void forcestop(); + int config(int i, int w, QString m); + +private slots: +#ifdef Q_WS_MAEMO_5 friend void GpsMaemo5_changed(LocationGPSDevice *device, GpsMaemo5 *gps); +#else + void gloc_reply(QNetworkReply *r); +#endif // Q_WS_MAEMO_5 private: double latitude; double longitude; double accuracy; - - GMainLoop *loop; + int interval; + int wait; + QString method; + bool emitfix; + bool stopgps; +#ifdef Q_WS_MAEMO_5 LocationGPSDControl *control; LocationGPSDevice *device; +#else + QUrl urlloc; + QNetworkAccessManager *worker; +#endif // Q_WS_MAEMO_5 }; +#ifdef Q_WS_MAEMO_5 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