File indexing completed on 2024-12-01 04:37:04

0001 /*
0002    SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "common/completionlineedit.h"
0010 #include "libruqolawidgets_private_export.h"
0011 class TeamRoomCompleterModel;
0012 class QTimer;
0013 class RocketChatAccount;
0014 class LIBRUQOLAWIDGETS_TESTS_EXPORT AddTeamRoomCompletionLineEdit : public CompletionLineEdit
0015 {
0016     Q_OBJECT
0017 public:
0018     struct RoomCompletionInfo {
0019         QString roomId;
0020         QString roomName;
0021     };
0022     explicit AddTeamRoomCompletionLineEdit(RocketChatAccount *account, QWidget *parent = nullptr);
0023     ~AddTeamRoomCompletionLineEdit() override;
0024 
0025 Q_SIGNALS:
0026     void newRoomName(const AddTeamRoomCompletionLineEdit::RoomCompletionInfo &);
0027 
0028 private:
0029     LIBRUQOLAWIDGETS_NO_EXPORT void slotSearchTimerFired();
0030     LIBRUQOLAWIDGETS_NO_EXPORT void slotSearchTextEdited();
0031     LIBRUQOLAWIDGETS_NO_EXPORT void slotTextChanged(const QString &text);
0032     LIBRUQOLAWIDGETS_NO_EXPORT void slotComplete(const QModelIndex &index);
0033     LIBRUQOLAWIDGETS_NO_EXPORT void slotAutoCompletTeamRoomDone(const QJsonObject &obj);
0034     TeamRoomCompleterModel *const mTeamRoomCompleterModel;
0035     QTimer *const mSearchTimer;
0036     RocketChatAccount *const mRocketChatAccount;
0037 };