chatwindow.h 852 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. private:
  29. ChatView *m_messageView;
  30. QLineEdit *m_inputEdit;
  31. // WebSocket客户端
  32. WebSocketClient *m_webSocketClient;
  33. };
  34. #endif // CHATWINDOW_H