blob: e30c05ec116db77b71a0e0e808c1e4ea3755b17d [file] [log] [blame]
Zhenkai Zhu6d589aa2012-05-29 17:34:35 -07001#ifndef CHATDIALOG_H
2#define CHATDIALOG_H
Zhenkai Zhub45e38a2012-06-01 15:44:36 -07003#include <boost/function.hpp>
4#include <vector>
5#include "digesttreescene.h"
Zhenkai Zhu6d589aa2012-05-29 17:34:35 -07006#include "ui_chatdialog.h"
Zhenkai Zhu5a8d5aa2012-05-30 21:25:23 -07007#include "chatbuf.pb.h"
Zhenkai Zhu90ee76c2012-06-01 16:00:25 -07008#include <sync-app-socket.h>
Zhenkai Zhu85845d22012-06-01 23:10:43 -07009#include <sync-logic.h>
10#include <sync-seq-no.h>
Zhenkai Zhu6d589aa2012-05-29 17:34:35 -070011
12class ChatDialog : public QDialog, private Ui::ChatDialog
13{
14 Q_OBJECT
15
16public:
17 ChatDialog(QWidget *parent = 0);
Zhenkai Zhub6338822012-05-31 13:27:24 -070018 void appendMessage(const SyncDemo::ChatMessage &msg);
Zhenkai Zhu85845d22012-06-01 23:10:43 -070019 void processData(const std::vector<Sync::MissingDataInfo> &, Sync::SyncAppSocket *);
Zhenkai Zhub45e38a2012-06-01 15:44:36 -070020
21private:
22 void formChatMessage(const QString &text, SyncDemo::ChatMessage &msg);
Zhenkai Zhu5a8d5aa2012-05-30 21:25:23 -070023
24private slots:
25 void returnPressed();
Zhenkai Zhu85845d22012-06-01 23:10:43 -070026 void buttonPressed();
Zhenkai Zhu5a8d5aa2012-05-30 21:25:23 -070027
28private:
29 QString m_nick;
30 QString m_chatroom;
Zhenkai Zhub45e38a2012-06-01 15:44:36 -070031 QString m_prefix;
32 Sync::SyncAppSocket *m_sock;
Zhenkai Zhu6d589aa2012-05-29 17:34:35 -070033};
34#endif