File indexing completed on 2024-09-29 04:28:03

0001 // SPDX-FileCopyrightText: 2023 James Graham <james.h.graham@protonmail.com>
0002 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0003 
0004 #pragma once
0005 
0006 #include <QObject>
0007 #include <QQmlEngine>
0008 
0009 /**
0010  * @class DelegateType
0011  *
0012  * This class is designed to define the DelegateType enumeration.
0013  */
0014 class DelegateType : public QObject
0015 {
0016     Q_OBJECT
0017     QML_ELEMENT
0018     QML_UNCREATABLE("")
0019 
0020 public:
0021     /**
0022      * @brief The type of delegate that is needed for the event.
0023      *
0024      * @note While similar this is not the matrix event or message type. This is
0025      *       to tell a QML ListView what delegate to show for each event. So while
0026      *       similar to the spec it is not the same.
0027      */
0028     enum Type {
0029         Emote, /**< A message that begins with /me. */
0030         Notice, /**< A notice event. */
0031         Image, /**< A message that is an image. */
0032         Audio, /**< A message that is an audio recording. */
0033         Video, /**< A message that is a video. */
0034         File, /**< A message that is a file. */
0035         Message, /**< A text message. */
0036         Sticker, /**< A message that is a sticker. */
0037         State, /**< A state event in the room. */
0038         Encrypted, /**< An encrypted message that cannot be decrypted. */
0039         ReadMarker, /**< The local user read marker. */
0040         Poll, /**< The initial event for a poll. */
0041         Location, /**< A location event. */
0042         LiveLocation, /**< The initial event of a shared live location (i.e., the place where this is supposed to be shown in the timeline). */
0043         Loading, /**< A delegate to tell the user more messages are being loaded. */
0044         TimelineEnd, /**< A delegate to inform that all messages are loaded. */
0045         Other, /**< Anything that cannot be classified as another type. */
0046     };
0047     Q_ENUM(Type);
0048 };