libQuotient
A Qt library for building matrix clients
Loading...
Searching...
No Matches
simplestateevents.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2017 Kitsune Ral <kitsune-ral@users.sf.net>
2// SPDX-FileCopyrightText: 2024 James Graham <james.h.graham@protonmail.com>
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#pragma once
6
7#include "stateevent.h"
9
10namespace Quotient {
11
12#define DEFINE_SIMPLE_STATE_EVENT(Name_, TypeId_, ValueType_, GetterName_, JsonKey_)
13 constexpr inline auto Name_##Key = JsonKey_##_L1;
14 class QUOTIENT_API Name_ : public ::Quotient::KeylessStateEventBase<
15 Name_, EventContent::SingleKeyValue<ValueType_, Name_##Key>> {
16 public:
17 using value_type = ValueType_;
18 QUO_EVENT(Name_, TypeId_)
19 using KeylessStateEventBase::KeylessStateEventBase;
20 auto GetterName_() const { return content().value; }
21 };
22 // End of macro
23
26 "topic")
29
31public:
32 QUO_EVENT(RoomServerAclEvent, "m.room.server_acl")
33
35
39};
40} // 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
#define DEFINE_SIMPLE_STATE_EVENT(Name_, TypeId_, ValueType_, GetterName_, JsonKey_)