QXmpp Version: 1.5.6
Loading...
Searching...
No Matches
QXmppFileShare.h
1// SPDX-FileCopyrightText: 2022 Linus Jahn <lnj@kaidan.im>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPFILESHARE_H
6#define QXMPPFILESHARE_H
7
8#include "QXmppGlobal.h"
9
10#include <any>
11#include <functional>
12
13#include <QSharedDataPointer>
14
15class QDomElement;
16class QUrl;
17class QXmlStreamWriter;
18class QXmppFileSharePrivate;
22
23class QXMPP_EXPORT QXmppFileShare
24{
25public:
27 Inline,
28 Attachment,
29 };
30
32 QXMPP_PRIVATE_DECLARE_RULE_OF_SIX(QXmppFileShare)
33
34 Disposition disposition() const;
35 void setDisposition(Disposition);
36
37 const QXmppFileMetadata &metadata() const;
38 void setMetadata(const QXmppFileMetadata &);
39
40 const QVector<QXmppHttpFileSource> &httpSources() const;
41 void setHttpSources(const QVector<QXmppHttpFileSource> &newHttpSources);
42
43 const QVector<QXmppEncryptedFileSource> &encryptedSources() const;
44 void setEncryptedSourecs(const QVector<QXmppEncryptedFileSource> &newEncryptedSources);
45
47 bool parse(const QDomElement &el);
48 void toXml(QXmlStreamWriter *writer) const;
49
50protected:
51 friend class QXmppFileSharingManager;
52 friend class QXmppFileUpload;
53
54 // Private, internally used API:
55 void visitSources(std::function<bool(const std::any &)> &&visitor) const;
56 void addSource(const std::any &source);
58
59private:
60 QSharedDataPointer<QXmppFileSharePrivate> d;
61};
62
63#endif // QXMPPFILESHARE_H
Represents an encrypted file source for file sharing.
Definition QXmppEncryptedFileSource.h:21
Definition QXmppFileMetadata.h:24
Definition QXmppFileShare.h:24
Disposition
Decides whether to display the file contents (e.g. an image) inline in the chat or as a file.
Definition QXmppFileShare.h:26
Definition QXmppFileSharingManager.h:121
Provides progress of stateless file sharing uploads.
Definition QXmppFileSharingManager.h:32
Definition QXmppHttpFileSource.h:16