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"
8
#
include
"single_key_value.h"
9
10
namespace
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
24
DEFINE_SIMPLE_STATE_EVENT
(
RoomNameEvent
,
"m.room.name"
,
QString
,
name
,
"name"
)
25
DEFINE_SIMPLE_STATE_EVENT
(
RoomTopicEvent
,
"m.room.topic"
,
QString
,
topic
,
26
"topic"
)
27
DEFINE_SIMPLE_STATE_EVENT
(
RoomPinnedEventsEvent
,
"m.room.pinned_events"
,
28
QStringList
,
pinnedEvents
,
"pinned"
)
29
30
class
QUOTIENT_API
RoomServerAclEvent
:
public
StateEvent
{
31
public
:
32
QUO_EVENT
(
RoomServerAclEvent
,
"m.room.server_acl"
)
33
34
using
StateEvent
::
StateEvent
;
35
36
QUO_CONTENT_GETTER
(
QStringList
,
allow
)
37
QUO_CONTENT_GETTER
(
bool
,
allowIpLiterals
)
38
QUO_CONTENT_GETTER
(
QStringList
,
deny
)
39
};
40
}
// namespace Quotient
Quotient::RoomServerAclEvent
Definition
simplestateevents.h:30
QUO_CONTENT_GETTER
#define QUO_CONTENT_GETTER(PartType_, PartName_)
Define an inline method obtaining a content part.
Definition
event.h:465
QUO_EVENT
#define QUO_EVENT(CppType_, MatrixType_)
Supply event metatype information in (specific) event types.
Definition
event.h:436
Quotient
Definition
accountregistry.h:13
QUOTIENT_API
#define QUOTIENT_API
Definition
quotient_export.h:22
DEFINE_SIMPLE_STATE_EVENT
#define DEFINE_SIMPLE_STATE_EVENT(Name_, TypeId_, ValueType_, GetterName_, JsonKey_)
Definition
simplestateevents.h:12
Quotient
events
simplestateevents.h
Generated by
1.9.8