QXmpp: QXmppHttpFileSharingProvider.h Source File

QXmpp Version: 1.14.2

Loading...
Searching...
No Matches
QXmppHttpFileSharingProvider.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 QXMPPHTTPFILESHARINGPROVIDER_H
7#define QXMPPHTTPFILESHARINGPROVIDER_H
8
9#include "QXmppFileSharingProvider.h"
10#include "QXmppHttpFileSource.h"
11
12class QXmppHttpUploadManager;
13class QNetworkAccessManager;
14
15class QXmppHttpFileSharingProviderPrivate;
16
17 class QXMPP_EXPORT QXmppHttpFileSharingProvider : public QXmppFileSharingProvider
18{
19public:
21 using SourceType = QXmppHttpFileSource;
23
24 QXmppHttpFileSharingProvider(QXmppHttpUploadManager *manager, QNetworkAccessManager *netManager);
25 ~QXmppHttpFileSharingProvider() override;
26
27 auto downloadFile(const std::any &source,
28 std::unique_ptr<QIODevice> target,
29 std::function<void(quint64, quint64)> reportProgress,
30 std::function<void(DownloadResult)> reportFinished) -> std::shared_ptr<Download> override;
31 auto uploadFile(std::unique_ptr<QIODevice> source,
32 const QXmppFileMetadata &info,
33 std::function<void(quint64, quint64)> reportProgress,
34 std::function<void(UploadResult)> reportFinished) -> std::shared_ptr<Upload> override;
35
36private:
37 std::unique_ptr<QXmppHttpFileSharingProviderPrivate> d;
38};
39
40#endif // QXMPPHTTPFILESHARINGPROVIDER_H
QXmppFileMetadata
Definition QXmppFileMetadata.h:24
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
QXmppHttpFileSharingProvider::QXmppHttpFileSharingProvider
QXmppHttpFileSharingProvider(QXmppHttpUploadManager *manager, QNetworkAccessManager *netManager)
Create a QXmppHttpFileSharingProvider.
Definition QXmppHttpFileSharingProvider.cpp:43
QXmppHttpFileSource
Definition QXmppHttpFileSource.h:17
QXmppHttpUploadManager
Definition QXmppHttpUploadManager.h:76