2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Jussi Laitinen - jussi.laitinen@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,
26 #include <QNetworkAccessManager>
28 #include "mapfetcher.h"
34 * @brief MapFetcher handles requests to get map tiles.
38 * @class MapFetcher mapfetcher.h "map/mapfetcher.h"
40 class MapFetcher : public QObject
46 * @brief Constructor for MapFetcher.
49 * @param parent parent object
51 MapFetcher(QNetworkAccessManager *manager, QObject *parent = 0);
56 * @brief Fetch image from given URL.
59 * @param url URL to image
61 void fetchMapImage(const QUrl &url);
65 * @brief Signal which is emitted when a map tile
66 * is received from the server and loaded to pixmap.
68 * @fn mapImageReceived
69 * @param url URL to image
70 * @param image image pixmap
72 void mapImageReceived(const QUrl &url, const QPixmap &image);
75 * @brief Signal which is emitted when there is error
79 * @param message error message
81 void error(const QString &message);
86 * @brief This slot is called when network manager has finished
89 * @fn downloadFinished
92 void downloadFinished(QNetworkReply *reply);
95 * @brief This slot is called when next download is started.
97 * @fn startNextDownload
99 void startNextDownload();
103 QNetworkAccessManager *m_manager;
104 QList<QNetworkReply*> currentDownloads;
105 QQueue<QUrl> downloadQueue;