-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtwitterapi.h
51 lines (40 loc) · 1.17 KB
/
twitterapi.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
#ifndef TWITTERAPI_H
#define TWITTERAPI_H
#include <QObject>
#include <QString>
#include <QUrl>
#include <QVariantMap>
#include "o2/o2settingsstore.h"
#include "o2/o1twitter.h"
#include "o2/oxtwitter.h"
#include "o2/o1requestor.h"
class TwitterAPI : public QObject {
Q_OBJECT
public:
explicit TwitterAPI(QObject* parent = 0);
~TwitterAPI();
void authenticate();
void get(const QUrl& url, QList<O1RequestParameter>& reqParams);
void get(const QUrl& url);
void post(const QUrl& url, QList<O1RequestParameter>& reqParams, QByteArray& data);
void post(const QUrl& url, QByteArray& data);
signals:
void extraTokensReady(const QVariantMap& extraTokens);
void linkingSucceeded();
void replyReceived(QNetworkReply* reply);
void replyFailed();
public slots:
private slots:
void onLinkingSuccess();
void onLinkingFailed();
void onOpenBrowser(const QUrl& url);
void onReply();
void onError(QNetworkReply::NetworkError code);
private:
O1Twitter* TwitterAuth;
O2SettingsStore* settings;
QNetworkAccessManager* manager;
O1Requestor* requestor;
QNetworkRequest request(const QUrl& url);
};
#endif // TWITTERAPI_H