QXmpp: QXmppBitsOfBinaryData.h Source File

QXmpp Version: 1.14.4

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;
17class QXmppBitsOfBinaryContentId;
18
19 class QXMPP_EXPORT QXmppBitsOfBinaryData
20{
21public:
22 static QXmppBitsOfBinaryData fromByteArray(QByteArray data);
23
24 QXmppBitsOfBinaryData();
25 QXmppBitsOfBinaryData(const QXmppBitsOfBinaryData &);
26 QXmppBitsOfBinaryData(QXmppBitsOfBinaryData &&);
27 ~QXmppBitsOfBinaryData();
28
29 QXmppBitsOfBinaryData &operator=(const QXmppBitsOfBinaryData &);
30 QXmppBitsOfBinaryData &operator=(QXmppBitsOfBinaryData &&);
31
32 QXmppBitsOfBinaryContentId cid() const;
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
QXmppBitsOfBinaryContentId
Definition QXmppBitsOfBinaryContentId.h:16
QXmppBitsOfBinaryData
Definition QXmppBitsOfBinaryData.h:20
QXmppBitsOfBinaryData::~QXmppBitsOfBinaryData
~QXmppBitsOfBinaryData()
Default destructor.
QXmppBitsOfBinaryData::cid
QXmppBitsOfBinaryContentId cid() const
Definition QXmppBitsOfBinary.cpp:92
QXmppBitsOfBinaryData::isBitsOfBinaryData
static bool isBitsOfBinaryData(const QDomElement &element)
Definition QXmppBitsOfBinary.cpp:169
QXmppBitsOfBinaryData::QXmppBitsOfBinaryData
QXmppBitsOfBinaryData(QXmppBitsOfBinaryData &&)
Default move-constructor.
QXmppBitsOfBinaryData::contentType
QMimeType contentType() const
Definition QXmppBitsOfBinary.cpp:137
QXmppBitsOfBinaryData::QXmppBitsOfBinaryData
QXmppBitsOfBinaryData(const QXmppBitsOfBinaryData &)
Default copy-constructor.
QXmppBitsOfBinaryData::setMaxAge
void setMaxAge(int maxAge)
Definition QXmppBitsOfBinary.cpp:126
QXmppBitsOfBinaryData::maxAge
int maxAge() const
Definition QXmppBitsOfBinary.cpp:113
QXmppBitsOfBinaryData::setCid
void setCid(const QXmppBitsOfBinaryContentId &cid)
Definition QXmppBitsOfBinary.cpp:100
QXmppBitsOfBinaryData::setData
void setData(const QByteArray &data)
Definition QXmppBitsOfBinary.cpp:161
QXmppBitsOfBinaryData::setContentType
void setContentType(const QMimeType &contentType)
Definition QXmppBitsOfBinary.cpp:145
QXmppBitsOfBinaryData::fromByteArray
static QXmppBitsOfBinaryData fromByteArray(QByteArray data)
Definition QXmppBitsOfBinary.cpp:57
QXmppBitsOfBinaryData::operator=
QXmppBitsOfBinaryData & operator=(const QXmppBitsOfBinaryData &)
Default assignment operator.
QXmppBitsOfBinaryData::operator=
QXmppBitsOfBinaryData & operator=(QXmppBitsOfBinaryData &&)
Default move-assignment operator.
QXmppBitsOfBinaryData::QXmppBitsOfBinaryData
QXmppBitsOfBinaryData()
Definition QXmppBitsOfBinary.cpp:73
QXmppBitsOfBinaryData::data
QByteArray data() const
Definition QXmppBitsOfBinary.cpp:153