summaryrefslogtreecommitdiff
path: root/src/imports/location/tileprovider.h
blob: 460b425bdbca8fd55843f64466a96813dacd9771 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef TILEPROVIDER_H
#define TILEPROVIDER_H

#include <QObject>
#include <QHash>

#include "tilespec.h"

class Tile;
class QNetworkAccessManager;
class QNetworkReply;

class TileProvider : public QObject
{
    Q_OBJECT
public:
    TileProvider(QObject *parent = 0);

public slots:
    void tileRequest(const TileSpec &spec);

private slots:
    void finished(QNetworkReply *reply);

signals:
    void tileReady(const Tile &tile);
    void tileError(const TileSpec &spec);

private:
    QNetworkAccessManager *nam_;
    QHash<QNetworkReply*, TileSpec> map_;
};

#endif // TILEPROVIDER_H