blob: b4c4b245e45b40a8f7c6b72803065fb0c799b2c2 [file] [log] [blame]
Zhenkai Zhufd52ab72012-05-29 17:34:35 -07001#ifndef CHATDIALOG_H
2#define CHATDIALOG_H
Zhenkai Zhu9ec8f412012-06-01 15:44:36 -07003#include <boost/function.hpp>
4#include <vector>
5#include "digesttreescene.h"
Zhenkai Zhufd52ab72012-05-29 17:34:35 -07006#include "ui_chatdialog.h"
Zhenkai Zhuc71da772012-05-30 21:25:23 -07007#include "chatbuf.pb.h"
Zhenkai Zhufd52ab72012-05-29 17:34:35 -07008
9class ChatDialog : public QDialog, private Ui::ChatDialog
10{
11 Q_OBJECT
12
13public:
14 ChatDialog(QWidget *parent = 0);
Zhenkai Zhu2c55b382012-05-31 13:27:24 -070015 void appendMessage(const SyncDemo::ChatMessage &msg);
Zhenkai Zhu9ec8f412012-06-01 15:44:36 -070016 void processData(const std::vector<MisingDataInfo> &, SyncAppSocket *);
17
18private:
19 void formChatMessage(const QString &text, SyncDemo::ChatMessage &msg);
Zhenkai Zhuc71da772012-05-30 21:25:23 -070020
21private slots:
22 void returnPressed();
Zhenkai Zhuc71da772012-05-30 21:25:23 -070023
24private:
25 QString m_nick;
26 QString m_chatroom;
Zhenkai Zhu9ec8f412012-06-01 15:44:36 -070027 QString m_prefix;
28 Sync::SyncAppSocket *m_sock;
Zhenkai Zhufd52ab72012-05-29 17:34:35 -070029};
30#endif