diff options
| author | Linus Jahn <lnj@kaidan.im> | 2022-09-13 23:11:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-13 23:11:19 +0200 |
| commit | a780d365fe9740d6533f4667fc8220eac148cd7d (patch) | |
| tree | 32842f8342e8a001aef03c3dcf22a7199b597805 /src/base/QXmppFileShare.h | |
| parent | c846f91c1750a35c17dbddcfd9176460765d5997 (diff) | |
| download | qxmpp-a780d365fe9740d6533f4667fc8220eac148cd7d.tar.gz | |
Implement XEP-0447: Stateless file sharing: File sharing element (#448)
Implements parsing for the file sharing element from XEP-0447:
Stateless files sharing version 0.2.
https://xmpp.org/extensions/xep-0447.html
Co-authored-by: Jonah BrĂ¼chert <jbb@kaidan.im>
Diffstat (limited to 'src/base/QXmppFileShare.h')
| -rw-r--r-- | src/base/QXmppFileShare.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/base/QXmppFileShare.h b/src/base/QXmppFileShare.h new file mode 100644 index 00000000..7d38df23 --- /dev/null +++ b/src/base/QXmppFileShare.h @@ -0,0 +1,52 @@ +// SPDX-FileCopyrightText: 2022 Linus Jahn <lnj@kaidan.im> +// +// SPDX-License-Identifier: LGPL-2.1-or-later + +#ifndef QXMPPFILESHARE_H +#define QXMPPFILESHARE_H + +#include "QXmppGlobal.h" + +#include <QSharedDataPointer> + +class QDomElement; +class QUrl; +class QXmlStreamWriter; +class QXmppFileSharePrivate; +class QXmppFileMetadata; + +class QXMPP_EXPORT QXmppFileShare +{ +public: + enum Disposition { + Inline, + Attachment, + }; + + QXmppFileShare(); + QXmppFileShare(const QXmppFileShare &); + QXmppFileShare(QXmppFileShare &&) noexcept; + ~QXmppFileShare(); + + QXmppFileShare &operator=(const QXmppFileShare &); + QXmppFileShare &operator=(QXmppFileShare &&) noexcept; + + Disposition disposition() const; + void setDisposition(Disposition); + + const QXmppFileMetadata &metadata() const; + void setMetadata(const QXmppFileMetadata &); + + const QVector<QUrl> &httpSources() const; + void setHttpSources(const QVector<QUrl> &newHttpSources); + + /// \cond + bool parse(const QDomElement &el); + void toXml(QXmlStreamWriter *writer) const; + /// \endcond + +private: + QSharedDataPointer<QXmppFileSharePrivate> d; +}; + +#endif // QXMPPFILESHARE_H |
