CCIMXDesktop
 
Loading...
Searching...
No Matches
ChatMainPanel.h
1#ifndef CHATMAINPANEL_H
2#define CHATMAINPANEL_H
3#include "CommunicatableStatus.h"
4#include <QWidget>
5class QLabel;
6class QListWidget;
7class QTextEdit;
8class QPushButton;
10class ChatMainPanel : public QWidget {
11 Q_OBJECT
12 static constexpr const char* HEADER_ICON[] = { "📞", "📷", "🖥️", "🔍", "+", "⋯" };
13 static constexpr const char* TOOL_ICON[] = { "☺", "✂", "📁", "🖼", "📎", "📹", "🔇", "🎤" };
14
15public:
16 explicit ChatMainPanel(QWidget* parent = nullptr);
17 void appendMessage(const QString& text, bool me, QPixmap avatar);
18
19 void setTitle(const QString& title);
20 QString getTitle() const;
21
22 void setCommunicateStatus(CommunicatableStatus communicatable);
23
24 void setEditWidgetEditable(bool editable);
25 bool editWidgetEditable() const;
26
27 void setSessionID(const QString& session_id);
28 QString getCurrentSessionID() const;
29
30 void clearShownMessages();
31signals:
32 void sendMessage(const QString& text);
33 void communicatableChanged(CommunicatableStatus new_status);
34
35protected:
36 void showEvent(QShowEvent* event);
37 void resizeEvent(QResizeEvent* event);
38private slots:
39 void sendClicked();
40
41private:
42 QLabel* title;
43 QLabel* statueIndicator;
44 QLabel* dotStatus;
45 QListWidget* listWidget;
46 QTextEdit* editor;
47 QPushButton* btn_send;
48 QWidget* input_widget;
49
50 QString session_id;
51 CommunicatableStatus communicate_status { CommunicatableStatus::OFFLINE };
52
53 void init_header();
54 void init_message_shown();
55 void init_input_widegt();
56
57 void adjustBubbleWidths();
58};
59
60#endif // CHATMAINPANEL_H
Definition ChatMainPanel.h:10
Definition HistoryContainers.h:7