version 0.2
[googlelatitude] / src / glatitude.h
diff --git a/src/glatitude.h b/src/glatitude.h
new file mode 100644 (file)
index 0000000..c3c3273
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef GLATITUDE_H
+#define GLATITUDE_H
+
+#include <QtNetwork>
+
+class GoogleLatitude : public QObject {
+    Q_OBJECT
+
+signals:
+    void setOK();
+    void setERROR();
+    void getOK();
+
+public slots:
+    void get();    
+
+public:
+    GoogleLatitude(QObject *parent = 0);
+    void login(QString username, QString password);
+    void set(double latitude, double longitude, double accuracy=1000.);
+    double get_lat() { return latitude; }
+    double get_lon() { return longitude; }
+    double get_acc() { return accuracy; }
+
+private slots:
+    void finishedreply(QNetworkReply *r);
+
+private:
+    // info
+    QString user;
+    QString pass;
+    double latitude;
+    double longitude;
+    double accuracy;
+    // stuff
+    QNetworkAccessManager *worker;
+    QUrl urllogin;
+    QUrl urldologin;
+    QUrl urlupdate;
+    QUrl urlloc;
+};
+
+#endif // GLATITUDE_H