1 /*
2    SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>
3 
4    SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include <QWidget>
10 
11 #include "channelsearchnamelineedit.h"
12 #include "libruqolawidgets_private_export.h"
13 class QStackedWidget;
14 class ChannelSearchNameLineEdit;
15 class ChannelSearchNameLineResultWidget;
16 class RocketChatAccount;
17 class LIBRUQOLAWIDGETS_TESTS_EXPORT ChannelSearchWidget : public QWidget
18 {
19     Q_OBJECT
20 public:
21     explicit ChannelSearchWidget(RocketChatAccount *account, QWidget *parent = nullptr);
22     ~ChannelSearchWidget() override;
23 
24     Q_REQUIRED_RESULT QString channelName() const;
25 
26     void setChannelInfo(const QString &name, const QString &channelId);
27 
28     Q_REQUIRED_RESULT QString channelId() const;
29 Q_SIGNALS:
30     void updateRoomName(bool valid);
31 
32 private:
33     void slotClearRoom();
34     void slotSelectedRoom(const ChannelSearchNameLineEdit::ChannelCompletionInfo &userInfo);
35     ChannelSearchNameLineEdit::ChannelCompletionInfo mUserInfo;
36     QStackedWidget *const mStackedWidget;
37     ChannelSearchNameLineEdit *const mChannelSearchNameLineEdit;
38     ChannelSearchNameLineResultWidget *const mChannelSearchLineResult;
39 };
40