6#include <QtCore/QObject>
15class CRemoteFileController:
public QObject
18 Q_PROPERTY(QString state READ state WRITE SetState NOTIFY stateChanged)
19 Q_PROPERTY(QString downloadedFileLocation READ downloadedFileLocation WRITE setDownloadedFileLocation NOTIFY downloadedFileLocationChanged)
20 Q_PROPERTY(QString downloadedFilePath READ downloadedFilePath WRITE setDownloadedFilePath NOTIFY downloadedFilePathChanged)
21 Q_PROPERTY(QByteArray json READ json WRITE setJson NOTIFY jsonChanged)
22 Q_PROPERTY(QString prefix READ prefix WRITE setPrefix NOTIFY prefixChanged)
25 QString m_downloadedFilePath;
28 Q_INVOKABLE
inline bool deleteFile(
const QString& fileId){
return DeleteFile(fileId); }
29 Q_INVOKABLE
inline bool getFile(
const QString& fileId,
const QString& fileName){
return GetFile(fileId, fileName); }
30 Q_INVOKABLE
inline bool sendFile(
const QString& fileId){
return SendFile(fileId); }
31 Q_INVOKABLE
inline bool openFile(
const QString& filePath = QString()){
return OpenFile(filePath); }
33 explicit CRemoteFileController(QObject* parent =
nullptr);
34 ~CRemoteFileController();
36 const QString& state()
const;
37 void SetState(
const QString& newState);
38 const QString& downloadedFilePath()
const;
39 void setDownloadedFilePath(
const QString& newDownloadedFilePath);
40 const QString& downloadedFileLocation()
const;
41 void setDownloadedFileLocation(
const QString& newDownloadedFileLocation);
42 const QByteArray& json()
const;
43 void setJson(
const QByteArray& newJson);
44 const QString& prefix()
const;
45 void setPrefix(
const QString& newPrefix);
48 virtual bool DeleteFile(
const QString& fileId);
49 virtual bool GetFile(
const QString& fileId,
const QString& fileName);
50 virtual bool SendFile(
const QString& fileUrl);
51 virtual bool OpenFile(
const QString& filePath = QString())
const;
56 void OnFileDownloaded();
57 void OnFileUploaded();
58 void OnProgressChanged(qint64 bytesLoaded, qint64 bytesTotal);
62 void downloadedFilePathChanged();
63 void downloadedFileLocationChanged();
65 void fileDownloaded(
const QString& filePath);
66 void progress(qint64 bytesLoaded, qint64 bytesTotal);
69 void fileUploadFailed();
70 void fileDeleteFailed();
71 void fileDownloadFailed();
94 QString m_preferredFileNameForSave;
95 QString m_downloadedFileLocation;
107Q_DECLARE_METATYPE(imtqml::CRemoteFileController*)