-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathqlivecodingchat.h
58 lines (45 loc) · 1.19 KB
/
qlivecodingchat.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef QLIVECODINGCHAT
#define QLIVECODINGCHAT
#include <QMap>
#include <QDateTime>
#include <QXmppClient.h>
#include "qchatservice.h"
#include "qchatsmile.h"
class QNetworkAccessManager;
class QXmppMucManager;
class QXmppMessage;
class QLivecodingChat: public QChatService
{
Q_OBJECT
public:
explicit QLivecodingChat( QObject * parent = 0 );
virtual ~QLivecodingChat();
private:
void loadSettings();
void getSmiles();
QString insertSmiles( const QString &message ) const;
protected:
virtual void timerEvent( QTimerEvent * event );
public slots:
virtual void connect();
virtual void disconnect();
virtual void reconnect();
private slots:
void onConnected();
void onError( QXmppClient::Error );
void onMessageReceived( const QXmppMessage &message );
void onSmilesLoaded();
void onSmilesLoadError();
private:
QNetworkAccessManager * nam_;
QXmppClient * xmppClient_;
QXmppMucManager *mucManager_;
QString channelName_;
QDateTime connectionTime_;
QMap<QString, QChatSmile> smiles_;
int reconnectTimerId_;
int reconnectInterval_;
int statisticTimerId_;
int statisticInterval_;
};
#endif // QLIVECODINGCHAT