Loading...
Searching...
No Matches
QXmppThumbnail.h
// SPDX-FileCopyrightText: 2022 Linus Jahn <lnj@kaidan.im>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPTHUMBNAIL_H
#define QXMPPTHUMBNAIL_H
#include "QXmppConstants_p.h"
#include "QXmppGlobal.h"
#include <optional>
#include <QSharedDataPointer>
class QDomElement;
class QMimeType;
class QXmlStreamWriter;
class QXmppThumbnailPrivate;
class QXMPP_EXPORT QXmppThumbnail
{
public:
QXmppThumbnail();
QXmppThumbnail(const QXmppThumbnail &);
QXmppThumbnail(QXmppThumbnail &&) noexcept;
~QXmppThumbnail();
QXmppThumbnail &operator=(const QXmppThumbnail &);
QXmppThumbnail &operator=(QXmppThumbnail &&) noexcept;
const QString &uri() const;
void setUri(const QString &newUri);
const QMimeType &mediaType() const;
void setMediaType(const QMimeType &);
std::optional<uint32_t> width() const;
void setWidth(std::optional<uint32_t>);
std::optional<uint32_t> height() const;
void setHeight(std::optional<uint32_t>);
static constexpr std::tuple XmlTag = { u"thumbnail", QXmpp::Private::ns_thumbs };
bool parse(const QDomElement &);
void toXml(QXmlStreamWriter *writer) const;
private:
QSharedDataPointer<QXmppThumbnailPrivate> d;
};
#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