Zhenkai Zhu | fd52ab7 | 2012-05-29 17:34:35 -0700 | [diff] [blame] | 1 | #ifndef CHATDIALOG_H |
| 2 | #define CHATDIALOG_H |
Zhenkai Zhu | 9ec8f41 | 2012-06-01 15:44:36 -0700 | [diff] [blame^] | 3 | #include <boost/function.hpp> |
| 4 | #include <vector> |
| 5 | #include "digesttreescene.h" |
Zhenkai Zhu | fd52ab7 | 2012-05-29 17:34:35 -0700 | [diff] [blame] | 6 | #include "ui_chatdialog.h" |
Zhenkai Zhu | c71da77 | 2012-05-30 21:25:23 -0700 | [diff] [blame] | 7 | #include "chatbuf.pb.h" |
Zhenkai Zhu | fd52ab7 | 2012-05-29 17:34:35 -0700 | [diff] [blame] | 8 | |
| 9 | class ChatDialog : public QDialog, private Ui::ChatDialog |
| 10 | { |
| 11 | Q_OBJECT |
| 12 | |
| 13 | public: |
| 14 | ChatDialog(QWidget *parent = 0); |
Zhenkai Zhu | 2c55b38 | 2012-05-31 13:27:24 -0700 | [diff] [blame] | 15 | void appendMessage(const SyncDemo::ChatMessage &msg); |
Zhenkai Zhu | 9ec8f41 | 2012-06-01 15:44:36 -0700 | [diff] [blame^] | 16 | void processData(const std::vector<MisingDataInfo> &, SyncAppSocket *); |
| 17 | |
| 18 | private: |
| 19 | void formChatMessage(const QString &text, SyncDemo::ChatMessage &msg); |
Zhenkai Zhu | c71da77 | 2012-05-30 21:25:23 -0700 | [diff] [blame] | 20 | |
| 21 | private slots: |
| 22 | void returnPressed(); |
Zhenkai Zhu | c71da77 | 2012-05-30 21:25:23 -0700 | [diff] [blame] | 23 | |
| 24 | private: |
| 25 | QString m_nick; |
| 26 | QString m_chatroom; |
Zhenkai Zhu | 9ec8f41 | 2012-06-01 15:44:36 -0700 | [diff] [blame^] | 27 | QString m_prefix; |
| 28 | Sync::SyncAppSocket *m_sock; |
Zhenkai Zhu | fd52ab7 | 2012-05-29 17:34:35 -0700 | [diff] [blame] | 29 | }; |
| 30 | #endif |