libQuotient
A Qt library for building matrix clients
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"
8
#
include
"single_key_value.h"
9
10
namespace
Quotient {
11
12
#
define
DEFINE_SIMPLE_STATE_EVENT
(
Name_
,
TypeId_
,
ValueType_
,
GetterName_
,
13
JsonKey_
)
14
constexpr
inline
auto
Name_
##
Key
=
JsonKey_
##
_ls
;
15
class
QUOTIENT_API
Name_
16
:
public
KeylessStateEventBase
<
17
Name_
,
EventContent
::
SingleKeyValue
<
ValueType_
,
Name_
##
Key
>>
{
18
public
:
19
using
value_type
=
ValueType_
;
20
QUO_EVENT
(
Name_
,
TypeId_
)
21
using
KeylessStateEventBase
::
KeylessStateEventBase
;
22
auto
GetterName_
(
)
const
{
return
content
(
)
.
value
;
}
23
}
;
24
// End of macro
25
26
DEFINE_SIMPLE_STATE_EVENT
(RoomNameEvent,
"m.room.name"
, QString, name,
"name"
)
27
DEFINE_SIMPLE_STATE_EVENT
(RoomTopicEvent,
"m.room.topic"
, QString, topic,
28
"topic"
)
29
DEFINE_SIMPLE_STATE_EVENT
(RoomPinnedEventsEvent,
"m.room.pinned_events"
,
30
QStringList, pinnedEvents,
"pinned"
)
31
32
class
QUOTIENT_API
RoomServerAclEvent :
public
StateEvent {
33
public
:
34
QUO_EVENT
(RoomServerAclEvent,
"m.room.server_acl"
)
35
36
using
StateEvent::StateEvent;
37
38
QUO_CONTENT_GETTER
(QStringList, allow)
39
QUO_CONTENT_GETTER
(
bool
, allowIpLiterals)
40
QUO_CONTENT_GETTER
(QStringList, deny)
41
};
42
}
// namespace Quotient
Quotient
events
simplestateevents.h
Generated by
1.9.1