16#ifndef QGSWEBDAVEXTERNALSTORAGE_H
17#define QGSWEBDAVEXTERNALSTORAGE_H
29class QgsHttpExternalStorageStoreTask;
44 QString
type()
const override;
64 QString
type()
const override;
86 QgsHttpExternalStorageStoredContent(
const QString &filePath,
const QString &url,
const QString &authcfg = QString() );
90 QString
url()
const override;
92 void store()
override;
94 void setPrepareRequestHandler( std::function<
void( QNetworkRequest &request, QFile *f ) > );
98 std::function< void( QNetworkRequest &request, QFile *f ) > mPrepareRequestHandler =
nullptr;
99 QPointer<QgsHttpExternalStorageStoreTask> mUploadTask;
120 void fetch()
override;
128 QPointer<QgsFetchedContent> mFetchedContent;
137class QgsHttpExternalStorageStoreTask :
public QgsTask
143 QgsHttpExternalStorageStoreTask(
const QUrl &url,
const QString &filePath,
const QString &authCfg );
149 QString errorString()
const;
151 void setPrepareRequestHandler( std::function<
void( QNetworkRequest &request, QFile *f ) > );
155 std::function< void( QNetworkRequest &request, QFile *f ) > mPrepareRequestHandler =
nullptr;
157 const QString mFilePath;
158 const QString mAuthCfg;
159 std::unique_ptr<QgsFeedback> mFeedback;
160 QString mErrorString;
virtual void cancel()
Cancels content fetching/storing.
Class for QgsExternalStorage fetched content.
virtual QString filePath() const =0
Returns fetched resource file path.
virtual void fetch()=0
Starts fetching.
Class for QgsExternalStorage stored content.
virtual QString url() const =0
Returns stored resource URL.
virtual void store()=0
Starts storing.
Abstract interface for external storage - to be implemented by various backends and registered in Qgs...
virtual QString type() const =0
Unique identifier of the external storage type.
virtual QgsExternalStorageFetchedContent * doFetch(const QString &url, const QString &authCfg=QString()) const =0
Fetches file from url using authCfg for this project external storage.
virtual QgsExternalStorageStoredContent * doStore(const QString &filePath, const QString &url, const QString &authCfg=QString()) const =0
Stores file filePath to the url using authCfg authentication for this project external storage.
virtual QString displayName() const =0
Returns the translated external storage name, which should be used for any user-visible display of th...
Base class for feedback objects to be used for cancellation of something running in a worker thread.
FetchedContent holds useful information about a network content being fetched.
Abstract base class for long running background tasks.
virtual bool run()=0
Performs the task's operation.
virtual void cancel()
Notifies the task that it should terminate.