QGIS API Documentation 3.99.0-Master (a5475b57e34)
Loading...
Searching...
No Matches
qgssimplecopyexternalstorage_p.h
Go to the documentation of this file.
1/***************************************************************************
2 qgssimplecopyexternalstorage_p.h
3 --------------------------------------
4 Date : March 2021
5 Copyright : (C) 2021 by Julien Cabieces
6 Email : julien dot cabieces at oslandia dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSSIMPLECOPYEXTERNALSTORAGE_H
17#define QGSSIMPLECOPYEXTERNALSTORAGE_H
18
19#include "qgis_core.h"
20#include "qgis_sip.h"
21#include "qgsexternalstorage.h"
22
23#include <QPointer>
24
25#define SIP_NO_FILE
26
28
29class QgsCopyFileTask;
30
37class CORE_EXPORT QgsSimpleCopyExternalStorage : public QgsExternalStorage
38{
39 public:
40
41 QString type() const override;
42
43 QString displayName() const override;
44
45 QgsExternalStorageStoredContent *doStore( const QString &filePath, const QString &url, const QString &authcfg = QString() ) const override;
46
47 QgsExternalStorageFetchedContent *doFetch( const QString &url, const QString &authConfig = QString() ) const override;
48};
49
55class QgsSimpleCopyExternalStorageStoredContent : public QgsExternalStorageStoredContent
56{
57 Q_OBJECT
58
59 public:
60
61 QgsSimpleCopyExternalStorageStoredContent( const QString &filePath, const QString &url, const QString &authcfg = QString() );
62
63 void cancel() override;
64
65 QString url() const override;
66
67 void store() override;
68
69 private:
70
71 QPointer<QgsCopyFileTask> mCopyTask;
72 QString mUrl;
73};
74
80class QgsSimpleCopyExternalStorageFetchedContent : public QgsExternalStorageFetchedContent
81{
82 Q_OBJECT
83
84 public:
85
86 QgsSimpleCopyExternalStorageFetchedContent( const QString &filePath );
87
88 QString filePath() const override;
89
90 void fetch() override;
91
92 private:
93
94 QString mFilePath;
95 QString mResultFilePath;
96};
97
99#endif // QGSSIMPLECOPYEXTERNALSTORAGE_H
Task to copy a file on disk.
virtual void cancel()
Cancels content fetching/storing.
Abstract base class for QgsExternalStorage fetched content.
virtual QString filePath() const =0
Returns fetched resource file path.
virtual void fetch()=0
Starts fetching.
Abstract base 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...