2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Henri Lampela - henri.lampela@ixonos.com
7 Situare is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 version 2 as published by the Free Software Foundation.
11 Situare is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Situare; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
22 #ifndef ROUTINGSERVICE_H
23 #define ROUTINGSERVICE_H
27 class NetworkAccessManager;
29 class QNetworkRequest;
33 * @brief RoutingService class for communicating with CloudMade server
34 * and parsing routing data
36 * @author Henri Lampela
37 * @class RoutingService routingservice.h "routingservice/routingservice.h"
39 class RoutingService : public QObject
46 * @brief Default constructor
48 * @param parent instance of parent
50 RoutingService(QObject *parent = 0);
58 /*******************************************************************************
59 * MEMBER FUNCTIONS AND SLOTS
60 ******************************************************************************/
64 * @brief Public slot, which indicates when http request has been completed
66 * @param reply storage for http reply
68 void requestFinished(QNetworkReply *reply);
73 * @brief Parses routing data from JSON string
75 * @param jsonReply JSON string
77 void parseRouteData(const QByteArray &jsonReply);
80 * @brief Sends http request
82 * @param url destination
84 void sendRequest(const QUrl &url);
86 /*******************************************************************************
88 ******************************************************************************/
93 * @brief Signals error
95 * @param context error context
96 * @param error error code
98 void error(const int context, const int error);
100 /*******************************************************************************
102 ******************************************************************************/
106 QList<QNetworkReply *> m_currentRequests; ///< List of current http requests
108 NetworkAccessManager *m_networkManager; ///< Pointer to QNetworkAccessManager
111 #endif // ROUTINGSERVICE_H