File indexing completed on 2024-04-28 16:11:02

0001 /*
0002    SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "libruqolacore_export.h"
0010 #include <QDebug>
0011 #include <QMap>
0012 #include <QString>
0013 
0014 class LIBRUQOLACORE_EXPORT AccountRoomSettings
0015 {
0016 public:
0017     struct LIBRUQOLACORE_EXPORT PendingTypedInfo {
0018         QString text;
0019         QString messageIdBeingEdited;
0020         QString threadMessageId;
0021         QString quotePermalink;
0022         QString quoteText;
0023         int scrollbarPosition = -1;
0024         [[nodiscard]] bool isValid() const;
0025     };
0026     AccountRoomSettings();
0027     ~AccountRoomSettings();
0028 
0029     void remove(const QString &roomId);
0030 
0031     void add(const QString &roomId, const PendingTypedInfo &info);
0032 
0033     [[nodiscard]] PendingTypedInfo value(const QString &roomId);
0034 
0035     [[nodiscard]] bool isEmpty() const;
0036 
0037 private:
0038     QMap<QString /*RoomId*/, PendingTypedInfo> mPendingTypedTexts;
0039 };
0040 LIBRUQOLACORE_EXPORT QDebug operator<<(QDebug d, const AccountRoomSettings::PendingTypedInfo &t);