CCIMXDesktop
 
Loading...
Searching...
No Matches
ChatListPanel.h
1#ifndef CHATLISTPANEL_H
2#define CHATLISTPANEL_H
3#include "core/ListContextInfo.h"
4#include <QWidget>
5class QLineEdit;
6class QStandardItemModel;
7class QListView;
8class Session;
9
10class ChatListPanel : public QWidget {
11 Q_OBJECT
12 static constexpr const unsigned short MAX_WIDTH = 300;
13
14public:
15 explicit ChatListPanel(QWidget* parent);
16 void append_context(Session* s, const ListContextInfo& info);
17 void append_context(Session* s, ListContextInfo&& info);
18 bool request_remove(const QString& name);
19
20 ListContextInfo request_info(Session* s) const;
21
22signals:
23 void request_search(const QString& target_name);
24 void currentContactChanged(Session* s);
25
26private:
27 QLineEdit* search_edit;
28 QStandardItemModel* standard_model;
29 QListView* listview;
30 QMap<Session*, ListContextInfo> contextInfos;
31 void config_view_and_model();
32 void init_searchbar();
33 void sync_once();
34 void process_new_add(const ListContextInfo& info);
35private slots:
36 void filterText(const QString& t);
37 void onCurrentChanged(const QModelIndex& current, const QModelIndex&);
38};
39
40#endif // CHATLISTPANEL_H
Definition ChatListPanel.h:10
Definition ListContextInfo.h:7
Definition Session.h:11