aboutsummaryrefslogtreecommitdiffstats
path: root/core/imagedownloader.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/imagedownloader.h')
-rw-r--r--core/imagedownloader.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/core/imagedownloader.h b/core/imagedownloader.h
new file mode 100644
index 000000000..f4e3df875
--- /dev/null
+++ b/core/imagedownloader.h
@@ -0,0 +1,34 @@
+#ifndef IMAGEDOWNLOADER_H
+#define IMAGEDOWNLOADER_H
+
+#include <QImage>
+#include <QFuture>
+#include <QNetworkReply>
+
+typedef QPair<QString, QByteArray> SHashedFilename;
+
+extern QUrl cloudImageURL(const char *hash);
+
+
+class ImageDownloader : public QObject {
+ Q_OBJECT;
+public:
+ ImageDownloader(struct picture *picture);
+ ~ImageDownloader();
+ void load(bool fromHash);
+
+private:
+ struct picture *picture;
+ QNetworkAccessManager manager;
+ bool loadFromHash;
+
+private slots:
+ void saveImage(QNetworkReply *reply);
+};
+
+class SHashedImage : public QImage {
+public:
+ SHashedImage(struct picture *picture);
+};
+
+#endif // IMAGEDOWNLOADER_H