Code cleanup
[GPXSee.git] / src / map / tileloader.h
blobdbcb2db82d6ce8d5ae9936c991f87c4791c2966d
1 #ifndef TILELOADER_H
2 #define TILELOADER_H
4 #include <QObject>
5 #include <QString>
6 #include "common/downloader.h"
7 #include "tile.h"
9 class TileLoader : public QObject
11 Q_OBJECT
13 public:
14 enum UrlType {
15 XYZ,
16 QuadTiles,
17 BoundingBox
20 TileLoader(const QString &dir, QObject *parent = 0);
22 void setUrl(const QString &url, UrlType type) {_url = url; _urlType = type;}
23 void setHeaders(const QList<HTTPHeader> &headers) {_headers = headers;}
24 void setScaledSize(int size);
26 void loadTilesAsync(QVector<FetchTile> &list);
27 void loadTilesSync(QVector<FetchTile> &list);
28 void clearCache();
30 signals:
31 void finished();
33 private:
34 QUrl tileUrl(const FetchTile &tile) const;
35 QString tileFile(const FetchTile &tile) const;
37 Downloader *_downloader;
38 QString _url;
39 UrlType _urlType;
40 QString _dir;
41 QList<HTTPHeader> _headers;
42 int _scaledSize;
45 #endif // TILELOADER_H