QXmpp Version: 1.12.0
Loading...
Searching...
No Matches
QXmppBitsOfBinaryData.h
1// SPDX-FileCopyrightText: 2019 Linus Jahn <lnj@kaidan.im>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPBITSOFBINARYDATA_H
6#define QXMPPBITSOFBINARYDATA_H
7
8#include "QXmppConstants_p.h"
9#include "QXmppGlobal.h"
10
11#include <QSharedDataPointer>
12
13class QDomElement;
14class QMimeType;
15class QXmlStreamWriter;
16class QXmppBitsOfBinaryDataPrivate;
18
19class QXMPP_EXPORT QXmppBitsOfBinaryData
20{
21public:
22 static QXmppBitsOfBinaryData fromByteArray(QByteArray data);
23
28
31
33 void setCid(const QXmppBitsOfBinaryContentId &cid);
34
35 int maxAge() const;
36 void setMaxAge(int maxAge);
37
38 QMimeType contentType() const;
39 void setContentType(const QMimeType &contentType);
40
41 QByteArray data() const;
42 void setData(const QByteArray &data);
43
44 bool static isBitsOfBinaryData(const QDomElement &element);
45
47 static constexpr std::tuple XmlTag = { u"data", QXmpp::Private::ns_bob };
48 void parseElementFromChild(const QDomElement &dataElement);
49 void toXmlElementFromChild(QXmlStreamWriter *writer) const;
51
52 bool operator==(const QXmppBitsOfBinaryData &other) const;
53
54private:
55 QSharedDataPointer<QXmppBitsOfBinaryDataPrivate> d;
56};
57
58#endif // QXMPPBITSOFBINARYDATA_H
Definition QXmppBitsOfBinaryContentId.h:16
Definition QXmppBitsOfBinaryData.h:20
~QXmppBitsOfBinaryData()
Default destructor.
QXmppBitsOfBinaryData(QXmppBitsOfBinaryData &&)
Default move-constructor.
QXmppBitsOfBinaryData(const QXmppBitsOfBinaryData &)
Default copy-constructor.
QXmppBitsOfBinaryData & operator=(const QXmppBitsOfBinaryData &)
Default assignment operator.
QXmppBitsOfBinaryData & operator=(QXmppBitsOfBinaryData &&)
Default move-assignment operator.