libosmscout 1.1.1
Loading...
Searching...
No Matches
OsmTileDownloader.h
Go to the documentation of this file.
1#ifndef OSMSCOUT_CLIENT_QT_OSMTILEDOWNLOADER_H
2#define OSMSCOUT_CLIENT_QT_OSMTILEDOWNLOADER_H
3
4/*
5 OSMScout - a Qt backend for libosmscout and libosmscout-map
6 Copyright (C) 2016 Lukas Karas
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#include <QObject>
24#include <QByteArray>
25#include <QNetworkAccessManager>
26#include <QNetworkRequest>
27#include <QNetworkReply>
28#include <QImage>
29#include <QNetworkDiskCache>
30
31#include <osmscoutclient/OnlineTileProvider.h>
32#include <osmscoutclient/Settings.h>
33
35
36namespace osmscout {
37
41class OsmTileDownloader : public QObject
42{
43 Q_OBJECT
44
45public:
46 OsmTileDownloader(QString diskCacheDir,
47 const OnlineTileProvider &provider);
49
50public slots:
51 void download(uint32_t zoomLevel, uint32_t x, uint32_t y);
52 void onlineTileProviderChanged(const OnlineTileProvider &provider);
53
54signals:
55 void downloaded(uint32_t zoomLevel, uint32_t x, uint32_t y, QImage image, QByteArray downloadedData);
56 void failed(uint32_t zoomLevel, uint32_t x, uint32_t y, bool zoomLevelOutOfRange);
57
58private slots:
59 void fileDownloaded(const TileCacheKey &key, QNetworkReply *reply);
60
61private:
62 quint32 serverNumber;
63 QNetworkAccessManager webCtrl;
64 QNetworkDiskCache diskCache;
65 OnlineTileProvider tileProvider;
66
67};
68
69}
70
71#endif /* OSMSCOUT_CLIENT_QT_OSMTILEDOWNLOADER_H */
void onlineTileProviderChanged(const OnlineTileProvider &provider)
void downloaded(uint32_t zoomLevel, uint32_t x, uint32_t y, QImage image, QByteArray downloadedData)
OsmTileDownloader(QString diskCacheDir, const OnlineTileProvider &provider)
void download(uint32_t zoomLevel, uint32_t x, uint32_t y)
void failed(uint32_t zoomLevel, uint32_t x, uint32_t y, bool zoomLevelOutOfRange)
Definition Area.h:39
Definition TileCache.h:53