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