QXmpp: QXmppThumbnail.h Source File

QXmpp Version: 1.14.3

Loading...
Searching...
No Matches
QXmppThumbnail.h
1// SPDX-FileCopyrightText: 2022 Linus Jahn <lnj@kaidan.im>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPTHUMBNAIL_H
6#define QXMPPTHUMBNAIL_H
7
8#include "QXmppConstants_p.h"
9#include "QXmppGlobal.h"
10
11#include <optional>
12
13#include <QSharedDataPointer>
14
15class QDomElement;
16class QMimeType;
17class QXmlStreamWriter;
18class QXmppThumbnailPrivate;
19
20 class QXMPP_EXPORT QXmppThumbnail
21{
22public:
23 QXmppThumbnail();
24 QXmppThumbnail(const QXmppThumbnail &);
25 QXmppThumbnail(QXmppThumbnail &&) noexcept;
26 ~QXmppThumbnail();
27
28 QXmppThumbnail &operator=(const QXmppThumbnail &);
29 QXmppThumbnail &operator=(QXmppThumbnail &&) noexcept;
30
31 const QString &uri() const;
32 void setUri(const QString &newUri);
33
34 const QMimeType &mediaType() const;
35 void setMediaType(const QMimeType &);
36
37 std::optional<uint32_t> width() const;
38 void setWidth(std::optional<uint32_t>);
39
40 std::optional<uint32_t> height() const;
41 void setHeight(std::optional<uint32_t>);
42
44 static constexpr std::tuple XmlTag = { u"thumbnail", QXmpp::Private::ns_thumbs };
45 bool parse(const QDomElement &);
46 void toXml(QXmlStreamWriter *writer) const;
48
49private:
50 QSharedDataPointer<QXmppThumbnailPrivate> d;
51};
52
53#endif // QXMPPTHUMBNAIL_H
QXmppThumbnail::setMediaType
void setMediaType(const QMimeType &)
Sets the MIME type of the thumbnail data.
Definition QXmppThumbnail.cpp:72
QXmppThumbnail::mediaType
const QMimeType & mediaType() const
Returns the MIME type of the thumbnail data.
Definition QXmppThumbnail.cpp:66
QXmppThumbnail::QXmppThumbnail
QXmppThumbnail(const QXmppThumbnail &)
Default copy-constructor.
QXmppThumbnail::width
std::optional< uint32_t > width() const
Returns the width of the thumbnail image.
Definition QXmppThumbnail.cpp:78
QXmppThumbnail::uri
const QString & uri() const
Returns the URI with the location for the data (usually a XEP-0231: Bits of Binary content ID).
Definition QXmppThumbnail.cpp:54
QXmppThumbnail::QXmppThumbnail
QXmppThumbnail(QXmppThumbnail &&) noexcept
Default move-constructor.
QXmppThumbnail::setHeight
void setHeight(std::optional< uint32_t >)
Sets the height of the thumbnail image.
Definition QXmppThumbnail.cpp:96
QXmppThumbnail::setWidth
void setWidth(std::optional< uint32_t >)
Sets the width of the thumbnail image.
Definition QXmppThumbnail.cpp:84
QXmppThumbnail::height
std::optional< uint32_t > height() const
Returns the height of the thumbnail image.
Definition QXmppThumbnail.cpp:90
QXmppThumbnail::QXmppThumbnail
QXmppThumbnail()
Default constructor.
Definition QXmppThumbnail.cpp:39
QXmppThumbnail::setUri
void setUri(const QString &newUri)
Sets the URI with the location for the data (usually a XEP-0231: Bits of Binary content ID).
Definition QXmppThumbnail.cpp:60