aboutsummaryrefslogtreecommitdiff
path: root/jobs/downloadfilejob.h
diff options
context:
space:
mode:
Diffstat (limited to 'jobs/downloadfilejob.h')
-rw-r--r--jobs/downloadfilejob.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/jobs/downloadfilejob.h b/jobs/downloadfilejob.h
new file mode 100644
index 00000000..d798506c
--- /dev/null
+++ b/jobs/downloadfilejob.h
@@ -0,0 +1,27 @@
+#pragma once
+
+#include "generated/content-repo.h"
+
+namespace QMatrixClient
+{
+ class DownloadFileJob : public GetContentJob
+ {
+ public:
+ enum { FileError = BaseJob::UserDefinedError + 1 };
+
+ DownloadFileJob(const QString& serverName, const QString& mediaId,
+ const QString& localFilename = {});
+
+ QString targetFileName() const;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+
+ void beforeStart(const ConnectionData*) override;
+ void afterStart(const ConnectionData*,
+ QNetworkReply* reply) override;
+ void beforeAbandon(QNetworkReply*) override;
+ Status parseReply(QNetworkReply*) override;
+ };
+}