QXmpp: QXmppEncryptedFileSharingProvider.h Source File

QXmpp Version: 1.14.3

Loading...
Searching...
No Matches
QXmppEncryptedFileSharingProvider.h
1// SPDX-FileCopyrightText: 2022 Jonah Brüchert <jbb@kaidan.im>
2// SPDX-FileCopyrightText: 2022 Linus Jahn <lnj@kaidan.im>
3//
4// SPDX-License-Identifier: LGPL-2.1-or-later
5
6#ifndef QXMPPENCRYPTEDHTTPFILESHARINGPROVIDER_H
7#define QXMPPENCRYPTEDHTTPFILESHARINGPROVIDER_H
8
9#include "QXmppEncryptedFileSource.h"
10#include "QXmppHttpFileSharingProvider.h"
11
12class QXmppFileSharingManager;
13class QXmppEncryptedFileSharingProviderPrivate;
14
15 class QXMPP_EXPORT QXmppEncryptedFileSharingProvider : public QXmppFileSharingProvider
16{
17public:
19 using SourceType = QXmppEncryptedFileSource;
21
22 QXmppEncryptedFileSharingProvider(QXmppFileSharingManager *manager, std::shared_ptr<QXmppFileSharingProvider> uploadBaseProvider);
23 ~QXmppEncryptedFileSharingProvider() override;
24
25 auto downloadFile(const std::any &source,
26 std::unique_ptr<QIODevice> target,
27 std::function<void(quint64, quint64)> reportProgress,
28 std::function<void(DownloadResult)> reportFinished) -> std::shared_ptr<Download> override;
29
30 auto uploadFile(std::unique_ptr<QIODevice> source,
31 const QXmppFileMetadata &info,
32 std::function<void(quint64, quint64)> reportProgress,
33 std::function<void(UploadResult)> reportFinished) -> std::shared_ptr<Upload> override;
34
35private:
36 std::unique_ptr<QXmppEncryptedFileSharingProviderPrivate> d;
37};
38
39#endif // QXMPPENCRYPTEDHTTPFILESHARINGPROVIDER_H
QXmppEncryptedFileSharingProvider::QXmppEncryptedFileSharingProvider
QXmppEncryptedFileSharingProvider(QXmppFileSharingManager *manager, std::shared_ptr< QXmppFileSharingProvider > uploadBaseProvider)
Create a new QXmppEncryptedFileSharingProvider.
Definition QXmppEncryptedFileSharingProvider.cpp:49
QXmppEncryptedFileSource
Represents an encrypted file source for file sharing.
Definition QXmppEncryptedFileSource.h:21
QXmppFileMetadata
Definition QXmppFileMetadata.h:24
QXmppFileSharingManager
Definition QXmppFileSharingManager.h:119
QXmppFileSharingProvider
The interface of a provider for the QXmppFileSharingManager.
Definition QXmppFileSharingProvider.h:32
QXmppFileSharingProvider::uploadFile
virtual auto uploadFile(std::unique_ptr< QIODevice > source, const QXmppFileMetadata &info, std::function< void(quint64, quint64)> reportProgress, std::function< void(UploadResult)> reportFinished) -> std::shared_ptr< Upload >=0
Handles the upload of a file for this provider.
QXmppFileSharingProvider::downloadFile
virtual auto downloadFile(const std::any &source, std::unique_ptr< QIODevice > target, std::function< void(quint64, quint64)> reportProgress, std::function< void(DownloadResult)> reportFinished) -> std::shared_ptr< Download >=0
Handles the download of files for this provider.
QXmppFileSharingProvider::DownloadResult
std::variant< QXmpp::Success, QXmpp::Cancelled, QXmppError > DownloadResult
Definition QXmppFileSharingProvider.h:36
QXmppFileSharingProvider::UploadResult
std::variant< std::any, QXmpp::Cancelled, QXmppError > UploadResult
Definition QXmppFileSharingProvider.h:40