Added functionality for other users listing and viewing other users info.
[speedfreak] / Client / httpclient.h
1 /*
2  * Http client Connects application to server.
3  *
4  * @author      Tiina Kivilinna-Korhola
5  * @author      Olavi Pulkkinen <olavi.pulkkinen@fudeco.com>
6  * @author      Toni Jussila    <toni.jussila@fudeco.com>
7  * @copyright   (c) 2010 Speed Freak team
8  * license      http://opensource.org/licenses/gpl-license.php GNU Public License
9  */
10
11 #ifndef HTTPCLIENT_H
12 #define HTTPCLIENT_H
13
14 #include <QNetworkAccessManager>
15 #include <QNetworkRequest>
16 #include <QNetworkReply>
17 #include "xmlwriter.h"
18 #include "xmlreader.h"
19 class MainWindow;
20
21
22
23 class HttpClient : public QObject {
24     Q_OBJECT
25 public:
26     HttpClient(MainWindow *myCarw);
27     ~HttpClient();
28     XmlWriter *myXmlwriter;
29     XmlReader *myXmlreader;
30
31 private:
32     MainWindow *myMainw;
33     QNetworkAccessManager *netManager;
34
35 signals:
36     void loginOK();
37
38 public slots:
39     void requestRegistration();
40     void checkLogin();
41     void sendResultXml(QString category, double result);
42     void sendRouteXml(QString oldName, QString newName, int i);
43     void requestTopList(QString category, QString limit);
44     void requestCategories();
45     void ackOfResult();
46     void ackOfRoute();
47     void ackOfRegistration();
48     void ackOfCategories();
49     void ackOfToplist();
50     void ackOfLogin();
51     bool ackOfProfile();
52     void ackOfSendingPicture();
53     void errorFromServer(QNetworkReply::NetworkError);
54     void sendProfileXml();
55     void requestUserInfo(QString username);
56     void ackOfUserInfo();
57
58     void requestUsers();
59     void ackOfUsers();
60     void sendUsersInfo(QStringList* usersInfo);
61
62 };
63
64 #endif // HTTPCLIENT_H