File indexing completed on 2024-05-19 05:04:05

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 <QWidget>
0010 
0011 #include "libruqolawidgets_private_export.h"
0012 class SearchMessageWithDelayLineEdit;
0013 class MessageListView;
0014 class QLabel;
0015 class CommonMessageFilterProxyModel;
0016 class RocketChatAccount;
0017 class Room;
0018 
0019 namespace TextEditTextToSpeech
0020 {
0021 class TextToSpeechContainerWidget;
0022 }
0023 
0024 class LIBRUQOLAWIDGETS_TESTS_EXPORT SearchMessageWidget : public QWidget
0025 {
0026     Q_OBJECT
0027 public:
0028     explicit SearchMessageWidget(RocketChatAccount *account, QWidget *parent = nullptr);
0029     ~SearchMessageWidget() override;
0030 
0031     [[nodiscard]] QString roomId() const;
0032     void setRoomId(const QString &roomId);
0033 
0034     void setModel(CommonMessageFilterProxyModel *model);
0035     void setRoom(Room *room);
0036     [[nodiscard]] RocketChatAccount *currentRocketChatAccount() const;
0037 
0038 Q_SIGNALS:
0039     void goToMessageRequested(const QString &messageId, const QString &messageDateTimeUtc);
0040 
0041 private:
0042     LIBRUQOLAWIDGETS_NO_EXPORT void slotSearchLineMessagesEnterPressed();
0043     LIBRUQOLAWIDGETS_NO_EXPORT void slotClearedMessages();
0044     LIBRUQOLAWIDGETS_NO_EXPORT void updateLabel();
0045     LIBRUQOLAWIDGETS_NO_EXPORT void slotSearchMessages(const QString &str);
0046     [[nodiscard]] LIBRUQOLAWIDGETS_NO_EXPORT QString displayShowSearch() const;
0047     QString mRoomId;
0048     QLabel *const mSearchLabel;
0049     SearchMessageWithDelayLineEdit *const mSearchLineEdit;
0050     MessageListView *const mResultListWidget;
0051     CommonMessageFilterProxyModel *mModel = nullptr;
0052     RocketChatAccount *const mCurrentRocketChatAccount;
0053     TextEditTextToSpeech::TextToSpeechContainerWidget *const mTextToSpeechWidget = nullptr;
0054 };