2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef CHAT_H
|
|
|
|
#define CHAT_H
|
|
|
|
|
2012-11-23 13:27:50 +00:00
|
|
|
#include <QStringList>
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
#include "ui_chatmainwindow.h"
|
|
|
|
#include "ui_chatsetnickname.h"
|
|
|
|
|
|
|
|
class ChatMainWindow: public QMainWindow, Ui::ChatMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
QString m_nickname;
|
|
|
|
QStringList m_messages;
|
|
|
|
public:
|
|
|
|
ChatMainWindow();
|
|
|
|
~ChatMainWindow();
|
|
|
|
|
|
|
|
void rebuildHistory();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void message(const QString &nickname, const QString &text);
|
|
|
|
void action(const QString &nickname, const QString &text);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void messageSlot(const QString &nickname, const QString &text);
|
|
|
|
void actionSlot(const QString &nickname, const QString &text);
|
|
|
|
void textChangedSlot(const QString &newText);
|
|
|
|
void sendClickedSlot();
|
|
|
|
void changeNickname();
|
|
|
|
void aboutQt();
|
|
|
|
void exiting();
|
|
|
|
};
|
|
|
|
|
|
|
|
class NicknameDialog: public QDialog, public Ui::NicknameDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2020-10-07 11:05:48 +00:00
|
|
|
NicknameDialog(QWidget *parent = nullptr);
|
2011-04-27 10:05:43 +00:00
|
|
|
};
|
|
|
|
|
2012-11-23 13:27:50 +00:00
|
|
|
#endif // CHAT_H
|