1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-18 17:40:48 +02:00
vcmi/launcher/lobby/chat_moc.h
2023-09-03 03:05:48 +04:00

59 lines
863 B
C++

#ifndef CHAT_MOC_H
#define CHAT_MOC_H
#include <QWidget>
namespace Ui {
class Chat;
}
class Chat : public QWidget
{
Q_OBJECT
enum ChatId
{
GLOBAL = 0,
ROOM
};
QCompleter namesCompleter;
QString username, session;
ChatId chatId = GLOBAL;
QVector<QTextDocument*> chatDocuments;
private:
void setChatId(ChatId);
public:
explicit Chat(QWidget *parent = nullptr);
~Chat();
void setUsername(const QString &);
void setSession(const QString &);
void clearUsers();
void addUser(const QString & user);
void chatMessage(const QString & title, QString body, bool isSystem = false);
signals:
void messageSent(QString);
public slots:
void sysMessage(QString body);
private slots:
void on_messageEdit_returnPressed();
void on_sendButton_clicked();
void on_chatSwitch_clicked();
private:
Ui::Chat *ui;
};
#endif // CHAT_MOC_H