chatwindow.h 867 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef CHATWINDOW_H
  2. #define CHATWINDOW_H
  3. #include <QDateTime>
  4. #include <QFileDialog>
  5. #include <QHBoxLayout>
  6. #include <QLineEdit>
  7. #include <QMainWindow>
  8. #include <QPushButton>
  9. #include <QVBoxLayout>
  10. #include <QCloseEvent>
  11. #include "network/websocketclient.h"
  12. class ChatView;
  13. class ChatWindow : public QWidget
  14. {
  15. Q_OBJECT
  16. public:
  17. ChatWindow(WebSocketClient *webSocketClient, QWidget *parent = nullptr);
  18. void initWebsocket(const QString &roomId);
  19. protected:
  20. void closeEvent(QCloseEvent *event) override;
  21. signals:
  22. void windowCloseRequested();
  23. private slots:
  24. void onSendClicked();
  25. void onImageClicked();
  26. void onFileClicked();
  27. void onRecallClicked();
  28. public slots:
  29. private:
  30. ChatView *m_messageView;
  31. QLineEdit *m_inputEdit;
  32. // WebSocket客户端
  33. WebSocketClient *m_webSocketClient;
  34. };
  35. #endif // CHATWINDOW_H