From 68f167995e7ba71a6f2e556a7a0eab3d234e2d1a Mon Sep 17 00:00:00 2001 From: Jonah BrĂ¼chert Date: Fri, 9 Sep 2022 23:15:10 +0200 Subject: 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 --- src/client/QXmppFileTransfer.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/client/QXmppFileTransfer.h (limited to 'src/client/QXmppFileTransfer.h') 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 +// +// SPDX-License-Identifier: LGPL-2.1-or-later + +#ifndef QXMPPFILETRANSFER_H +#define QXMPPFILETRANSFER_H + +#include "QXmppGlobal.h" + +#include + +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 -- cgit v1.2.3