aboutsummaryrefslogtreecommitdiff
path: root/src/client/QXmppFileTransfer.h
diff options
context:
space:
mode:
authorJonah BrĂ¼chert <jbb@kaidan.im>2022-09-09 23:15:10 +0200
committerLinus Jahn <lnj@kaidan.im>2022-09-29 23:46:36 +0200
commit68f167995e7ba71a6f2e556a7a0eab3d234e2d1a (patch)
treede645b606d96f01da7ea6db63e90224519a89de3 /src/client/QXmppFileTransfer.h
parent7b02df3ef42ccb2d8c40eea901c5c6dd4b140204 (diff)
downloadqxmpp-68f167995e7ba71a6f2e556a7a0eab3d234e2d1a.tar.gz
Implement XEP-0448: Stateless File Sharing
This adds a file sharing manager that is capable of using multiple back ends. Currently implemented are a normal HTTP File Upload backend and an encrypted HTTP File Upload. Jingle File Transfer could be implemented later. Co-authored-by: Linus Jahn <lnj@kaidan.im>
Diffstat (limited to 'src/client/QXmppFileTransfer.h')
-rw-r--r--src/client/QXmppFileTransfer.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/client/QXmppFileTransfer.h b/src/client/QXmppFileTransfer.h
new file mode 100644
index 00000000..30a91aa9
--- /dev/null
+++ b/src/client/QXmppFileTransfer.h
@@ -0,0 +1,31 @@
+// SPDX-FileCopyrightText: 2022 Linus Jahn <lnj@kaidan.im>
+//
+// SPDX-License-Identifier: LGPL-2.1-or-later
+
+#ifndef QXMPPFILETRANSFER_H
+#define QXMPPFILETRANSFER_H
+
+#include "QXmppGlobal.h"
+
+#include <QObject>
+
+class QXMPP_EXPORT QXmppFileTransfer : public QObject
+{
+ Q_OBJECT
+ /// Progress of the file transfer between 0.0 and 1.0.
+ Q_PROPERTY(float progress READ progress NOTIFY progressChanged)
+
+public:
+ /// Returns the current progress between 0.0 and 1.0.
+ virtual float progress() = 0;
+ virtual void cancel() = 0;
+ virtual bool isFinished() = 0;
+ virtual quint64 bytesTransferred() = 0;
+ virtual quint64 bytesTotal() = 0;
+
+ // TODO consider adding speed getter
+
+ Q_SIGNAL void progressChanged();
+};
+
+#endif // QXMPPFILETRANSFER_H