diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-04-13 12:36:03 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-04-13 14:44:04 +0900 |
commit | b68186efc5fcedad6980686c8a07bab3b47a874d (patch) | |
tree | 1aaf5de974996279ec7e82af199d65fc5a187a48 /lib/jobs/downloadfilejob.h | |
parent | 44764f015f25db307811f2969c117b37133fc676 (diff) | |
parent | 7ca442a432994a19a86d43c917a1f537bcebb387 (diff) | |
download | libquotient-b68186efc5fcedad6980686c8a07bab3b47a874d.tar.gz libquotient-b68186efc5fcedad6980686c8a07bab3b47a874d.zip |
Merge branch 'master' into kitsune-gtad
Diffstat (limited to 'lib/jobs/downloadfilejob.h')
-rw-r--r-- | lib/jobs/downloadfilejob.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/jobs/downloadfilejob.h b/lib/jobs/downloadfilejob.h new file mode 100644 index 00000000..1815a7c8 --- /dev/null +++ b/lib/jobs/downloadfilejob.h @@ -0,0 +1,30 @@ +#pragma once + +#include "generated/content-repo.h" + +namespace QMatrixClient +{ + class DownloadFileJob : public GetContentJob + { + public: + enum { FileError = BaseJob::UserDefinedError + 1 }; + + using GetContentJob::makeRequestUrl; + static QUrl makeRequestUrl(QUrl baseUrl, const QUrl& mxcUri); + + 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; + }; +} |