libQuotient
A Qt library for building matrix clients
Loading...
Searching...
No Matches
stickerevent.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2020 Carl Schwan <carlschwan@kde.org>
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include "roomevent.h"
7#include "eventcontent.h"
8
9namespace Quotient {
10
11/// Sticker messages are specialised image messages that are displayed without
12/// controls (e.g. no "download" link, or light-box view on click, as would be
13/// displayed for for m.image events).
15{
16public:
17 QUO_EVENT(StickerEvent, "m.sticker")
18
19 explicit StickerEvent(const QJsonObject& obj)
20 : RoomEvent(obj)
22 EventContent::ImageContent(obj["content"_L1].toObject()))
23 {}
24
25 /// \brief A textual representation or associated description of the
26 /// sticker image.
27 ///
28 /// This could be the alt text of the original image, or a message to
29 /// accompany and further describe the sticker.
31
32 /// \brief Metadata about the image referred to in url including a
33 /// thumbnail representation.
35 {
36 return m_imageContent;
37 }
38
39 /// \brief The URL to the sticker image. This must be a valid mxc:// URI.
40 QUrl url() const
41 {
42 return m_imageContent.url();
43 }
44
45private:
47};
48} // namespace Quotient
#define QUO_CONTENT_GETTER(PartType_, PartName_)
Define an inline method obtaining a content part.
Definition event.h:465
#define QUO_EVENT(CppType_, MatrixType_)
Supply event metatype information in (specific) event types.
Definition event.h:436
#define QUOTIENT_API