diff options
Diffstat (limited to 'lib/jobs/downloadfilejob.h')
-rw-r--r-- | lib/jobs/downloadfilejob.h | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/lib/jobs/downloadfilejob.h b/lib/jobs/downloadfilejob.h index ce47ab1c..cbbfd244 100644 --- a/lib/jobs/downloadfilejob.h +++ b/lib/jobs/downloadfilejob.h @@ -1,30 +1,33 @@ +// SPDX-FileCopyrightText: 2018 Kitsune Ral <Kitsune-Ral@users.sf.net> +// SPDX-License-Identifier: LGPL-2.1-or-later + #pragma once #include "csapi/content-repo.h" -namespace QMatrixClient -{ - class DownloadFileJob : public GetContentJob - { - public: - enum { FileError = BaseJob::UserDefinedError + 1 }; +#include "events/filesourceinfo.h" - using GetContentJob::makeRequestUrl; - static QUrl makeRequestUrl(QUrl baseUrl, const QUrl& mxcUri); +namespace Quotient { +class QUOTIENT_API DownloadFileJob : public GetContentJob { +public: + using GetContentJob::makeRequestUrl; + static QUrl makeRequestUrl(QUrl baseUrl, const QUrl& mxcUri); - DownloadFileJob(const QString& serverName, const QString& mediaId, - const QString& localFilename = {}); + DownloadFileJob(const QString& serverName, const QString& mediaId, + const QString& localFilename = {}); - QString targetFileName() const; +#ifdef Quotient_E2EE_ENABLED + DownloadFileJob(const QString& serverName, const QString& mediaId, const EncryptedFileMetadata& file, const QString& localFilename = {}); +#endif + QString targetFileName() const; - private: - class Private; - QScopedPointer<Private> d; +private: + class Private; + ImplPtr<Private> d; - void beforeStart(const ConnectionData*) override; - void afterStart(const ConnectionData*, - QNetworkReply* reply) override; - void beforeAbandon(QNetworkReply*) override; - Status parseReply(QNetworkReply*) override; - }; -} + void doPrepare() override; + void onSentRequest(QNetworkReply* reply) override; + void beforeAbandon() override; + Status prepareResult() override; +}; +} // namespace Quotient |