00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef MAPNETWORK_H
00027 #define MAPNETWORK_H
00028
00029 #include <QObject>
00030 #include <QDebug>
00031 #include <QHttp>
00032 #include <QVector>
00033 #include <QPixmap>
00034 #include "imagemanager.h"
00038 namespace qmapcontrol
00039 {
00040 class ImageManager;
00041 class MapNetwork : QObject
00042 {
00043 Q_OBJECT
00044
00045 public:
00046 MapNetwork(ImageManager* parent);
00047 ~MapNetwork();
00048
00049 void loadImage(const QString& host, const QString& url);
00050
00056 bool imageIsLoading(QString url);
00057
00062 void abortLoading();
00063 void setProxy(QString host, int port);
00064
00065 private:
00066 ImageManager* parent;
00067 QHttp* http;
00068 QMap<int, QString> loadingMap;
00069 qreal loaded;
00070 QMutex vectorMutex;
00071 MapNetwork& operator=(const MapNetwork& rhs);
00072 MapNetwork(const MapNetwork& old);
00073
00074 private slots:
00075 void requestFinished(int id, bool error);
00076 };
00077 }
00078 #endif