Moved the from and to locations out of HttpClient into main, and added set/get method...
[ptas] / zouba / qt / httpclient.h
1 #ifndef HTTPCLIENT_H
2 #define HTTPCLIENT_H
3
4 #include "ui_zouba.h"
5
6 #include "location.h"
7
8 #include <QObject>
9 #include <QNetworkReply>
10 #include <QNetworkAccessManager>
11
12 class HttpClientPrivate;
13
14 class HttpClient: public QObject
15 {
16   Q_OBJECT
17
18 public:
19   HttpClient( Ui::MainWindow *ui );
20   ~HttpClient();
21
22   Q_PROPERTY(Location fromLocation READ fromLocation WRITE setFromLocation);
23   Q_PROPERTY(Location toLocation READ toLocation WRITE setFromLocation);
24
25   /*!
26     * \brief Gets the route data from the server
27     */
28   void get();
29
30   /*!
31     * \brief Sets the from location
32     * \param fromLocation The from location
33     */
34   void setFromLocation( Location fromLocation );
35
36   /*!
37     \brief Get the from location
38     \return The from location
39     */
40   Location fromLocation();
41
42   /*!
43     * \brief Sets the to location
44     * \param toLocation The to location
45     */
46   void setToLocation( Location toLocation );
47
48   /*!
49     \brief Get the to location
50     \return The to location
51     */
52   Location toLocation();
53
54 public Q_SLOTS:
55   void replyFinished(QNetworkReply*);
56
57 private:
58   HttpClientPrivate *q;
59   QNetworkAccessManager *manager;
60   Ui::MainWindow *ui;
61 };
62 #endif // HTTPCLIENT_H