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 | 85845d2 | 2012-06-01 23:10:43 -0700 | [diff] [blame^] | 9 | #include <sync-logic.h> |
| 10 | #include <sync-seq-no.h> |
Zhenkai Zhu | 6d589aa | 2012-05-29 17:34:35 -0700 | [diff] [blame] | 11 | |
| 12 | class ChatDialog : public QDialog, private Ui::ChatDialog |
| 13 | { |
| 14 | Q_OBJECT |
| 15 | |
| 16 | public: |
| 17 | ChatDialog(QWidget *parent = 0); |
Zhenkai Zhu | b633882 | 2012-05-31 13:27:24 -0700 | [diff] [blame] | 18 | void appendMessage(const SyncDemo::ChatMessage &msg); |
Zhenkai Zhu | 85845d2 | 2012-06-01 23:10:43 -0700 | [diff] [blame^] | 19 | void processData(const std::vector<Sync::MissingDataInfo> &, Sync::SyncAppSocket *); |
Zhenkai Zhu | b45e38a | 2012-06-01 15:44:36 -0700 | [diff] [blame] | 20 | |
| 21 | private: |
| 22 | void formChatMessage(const QString &text, SyncDemo::ChatMessage &msg); |
Zhenkai Zhu | 5a8d5aa | 2012-05-30 21:25:23 -0700 | [diff] [blame] | 23 | |
| 24 | private slots: |
| 25 | void returnPressed(); |
Zhenkai Zhu | 85845d2 | 2012-06-01 23:10:43 -0700 | [diff] [blame^] | 26 | void buttonPressed(); |
Zhenkai Zhu | 5a8d5aa | 2012-05-30 21:25:23 -0700 | [diff] [blame] | 27 | |
| 28 | private: |
| 29 | QString m_nick; |
| 30 | QString m_chatroom; |
Zhenkai Zhu | b45e38a | 2012-06-01 15:44:36 -0700 | [diff] [blame] | 31 | QString m_prefix; |
| 32 | Sync::SyncAppSocket *m_sock; |
Zhenkai Zhu | 6d589aa | 2012-05-29 17:34:35 -0700 | [diff] [blame] | 33 | }; |
| 34 | #endif |