-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathqtwitchchat.h
82 lines (59 loc) · 1.59 KB
/
qtwitchchat.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef QTWITCHCHAT_H
#define QTWITCHCHAT_H
//#include <QList>
#include <QMap>
#include "qchatsmile.h"
#include "qchatservice.h"
class QTcpSocket;
class QNetworkAccessManager;
class QNetworkReply;
class QTwitchChat: public QChatService
{
Q_OBJECT
public:
explicit QTwitchChat( QObject *parent = 0 );
virtual ~QTwitchChat();
void loadSettings();
QString emotIcon( const QString& smileName );
private:
void getSelf();
void getEmotIcons();
void getBadges();
void getStatistic();
QString insertEmotIcons( const QString& message ) const;
void safeDeleteSocket();
protected:
virtual void timerEvent( QTimerEvent * );
public slots:
virtual void connect();
virtual void disconnect();
virtual void reconnect();
private slots:
void onConnected();
void parseMessage();
void onSocketError();
void onSelfLoaded();
void onSelfLoadError();
void onEmotIconsLoaded();
void onEmotIconsLoadError();
void onBadgesLoaded();
void onBadgesLoadError();
void onStatisticLoaded();
void onStatisticLoadError();
private:
QTcpSocket *socket_;
QNetworkAccessManager *nam_;
QString oauthString_;
QString nickName_;
QString channelName_;
QString selfLink_;
QString emotIconsLink_;
QString badgesLink_;
//QList<QChatSmile> emotIcons_;
QMap<QString, QChatSmile> emotIcons_;
int reconnectTimerId_;
int reconnectInterval_;
int statisticTimerId_;
int statisticInterval_;
};
#endif // QTWITCHCHAT_H