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

0001 /*
0002    SPDX-FileCopyrightText: 2018-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 <QMap>
0011 #include <QObject>
0012 class LIBRUQOLACORE_EXPORT ReceiveTypingNotificationManager : public QObject
0013 {
0014     Q_OBJECT
0015 public:
0016     explicit ReceiveTypingNotificationManager(QObject *parent = nullptr);
0017     ~ReceiveTypingNotificationManager() override;
0018 
0019     void insertTypingNotification(const QString &roomId, const QString &userName, bool onTyping);
0020 
0021     [[nodiscard]] QString typingNotification(const QString &roomId) const;
0022 
0023     void clearTypingNotification();
0024 Q_SIGNALS:
0025     void notificationChanged(const QString &roomId, const QString &notificationStr);
0026     void clearNotification();
0027 
0028 private:
0029     Q_DISABLE_COPY(ReceiveTypingNotificationManager)
0030     [[nodiscard]] LIBRUQOLACORE_NO_EXPORT QString generateNotification(const QStringList &userNames) const;
0031     QMap<QString, QStringList> mMapTypingNotifications;
0032 };