-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtraktrequest.h
58 lines (43 loc) · 1.2 KB
/
traktrequest.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
#ifndef TRAKTREQUEST_H
#define TRAKTREQUEST_H
#include <QObject>
#include <QUrlQuery>
#include <QVariantMap>
class TraktConnection;
class TraktReply;
class TraktRequest : public QObject
{
Q_OBJECT
public:
enum Operation {
OperationGet,
OperationPost
};
explicit TraktRequest(QObject *parent = 0);
explicit TraktRequest(TraktConnection *connection, QObject *parent = 0);
QVariantMap data() const;
void setData(const QVariantMap &data);
Operation operation() const;
void setOperation(Operation operation);
QString path() const;
void setPath(const QString &path);
void setPage(int page);
void setLimit(int limit);
void addQueryItem(const QString &key, const QString &value);
void replaceQueryItem(const QString &key, const QString &value);
void removeQueryItem(const QString &key);
QUrlQuery query() const;
Q_INVOKABLE void fire();
Q_INVOKABLE void send();
signals:
void replyReceived(TraktReply *reply);
private:
TraktConnection *m_connection;
QVariantMap m_data;
Operation m_operation;
QString m_path;
QUrlQuery m_query;
private slots:
void cleanup(TraktReply *reply);
};
#endif // TRAKTREQUEST_H