2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Henri Lampela - henri.lampela@ixonos.com
6 Sami Rämö - sami.ramo@ixonos.com
8 Situare is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 version 2 as published by the Free Software Foundation.
12 Situare is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Situare; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
23 #ifndef GEOCODINGSERVICE_H
24 #define GEOCODINGSERVICE_H
33 class NetworkAccessManager;
36 * @brief Geocoding service
38 * Searching coordinates for places based on names and addresses. Parsing the result json data into
41 * @author Henri Lampela - henri.lampela@ixonos.com
42 * @author Sami Rämö - sami.ramo@ixonos.com
44 class GeocodingService : public QObject
50 * @brief Default constructor
52 * @param parent instance of parent
54 GeocodingService(QObject *parent = 0);
56 /*******************************************************************************
57 * MEMBER FUNCTIONS AND SLOTS
58 ******************************************************************************/
61 * @brief Public slot, which indicates when http request has been completed
63 * @param reply storage for http reply
65 void requestFinished(QNetworkReply *reply);
68 * @brief Request location information from the server
70 * @param location location (address, city etc.)
72 void requestLocation(const QString &location);
76 * @brief Parses location data from JSON string
78 * @param jsonReply JSON string
80 void parseSearchResults(const QByteArray &jsonReply);
83 * @brief Sends http request
85 * @param url destination
87 void sendRequest(const QUrl &url);
89 /*******************************************************************************
91 ******************************************************************************/
94 * @brief Signals error
96 * @param context error context
97 * @param error error code
99 void error(const int context, const int error);
102 * @brief Emited when location request is parsed and is ready for further processing
104 * @param result List of Location items
106 void locationDataParsed(const QList<Location> &result);
108 /*******************************************************************************
110 ******************************************************************************/
112 QList<Location> m_searchResults; ///< List of search results
114 NetworkAccessManager *m_networkManager; ///< Pointer to QNetworkAccessManager
117 #endif // GEOCODINGSERVICE_H