libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout-client-qt
include
osmscoutclientqt
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
34
#include <
osmscoutclientqt/TileCache.h
>
35
36
namespace
osmscout
{
37
41
class
OsmTileDownloader
:
public
QObject
42
{
43
Q_OBJECT
44
45
public
:
46
OsmTileDownloader
(QString diskCacheDir,
47
const
OnlineTileProvider &provider);
48
~OsmTileDownloader
()
override
;
49
50
public
slots:
51
void
download
(uint32_t zoomLevel, uint32_t x, uint32_t y);
52
void
onlineTileProviderChanged
(
const
OnlineTileProvider &provider);
53
54
signals:
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
58
private
slots:
59
void
fileDownloaded(
const
TileCacheKey
&key, QNetworkReply *reply);
60
61
private
:
62
quint32 serverNumber;
63
QNetworkAccessManager webCtrl;
64
QNetworkDiskCache diskCache;
65
OnlineTileProvider tileProvider;
66
67
};
68
69
}
70
71
#endif
/* OSMSCOUT_CLIENT_QT_OSMTILEDOWNLOADER_H */
TileCache.h
osmscout::OsmTileDownloader::onlineTileProviderChanged
void onlineTileProviderChanged(const OnlineTileProvider &provider)
osmscout::OsmTileDownloader::downloaded
void downloaded(uint32_t zoomLevel, uint32_t x, uint32_t y, QImage image, QByteArray downloadedData)
osmscout::OsmTileDownloader::OsmTileDownloader
OsmTileDownloader(QString diskCacheDir, const OnlineTileProvider &provider)
osmscout::OsmTileDownloader::~OsmTileDownloader
~OsmTileDownloader() override
osmscout::OsmTileDownloader::download
void download(uint32_t zoomLevel, uint32_t x, uint32_t y)
osmscout::OsmTileDownloader::failed
void failed(uint32_t zoomLevel, uint32_t x, uint32_t y, bool zoomLevelOutOfRange)
osmscout
Definition
Area.h:39
osmscout::TileCacheKey
Definition
TileCache.h:53
Generated by
1.17.0