#ifndef CHATWINDOW_H
#define CHATWINDOW_H

#include <QDateTime>
#include <QFileDialog>
#include <QHBoxLayout>
#include <QLineEdit>
#include <QMainWindow>
#include <QPushButton>
#include <QVBoxLayout>
#include <QCloseEvent>
#include "network/websocketclient.h"

class ChatView;

class ChatWindow : public QWidget
{
    Q_OBJECT
public:
    ChatWindow(WebSocketClient *webSocketClient, QWidget *parent = nullptr);

    void initWebsocket(const QString &roomId);

protected:
    void closeEvent(QCloseEvent *event) override;

signals:
    void windowCloseRequested();

private slots:
    void onSendClicked();

    void onImageClicked();

    void onFileClicked();

    void onRecallClicked();

private:
    ChatView *m_messageView;
    QLineEdit *m_inputEdit;

    // WebSocket客户端
    WebSocketClient *m_webSocketClient;
};

#endif // CHATWINDOW_H
