Newer
Older
*
* @author Akira Ohgaki <akiraohgaki@gmail.com>
* @copyright Akira Ohgaki
*/
#pragma once
#include <QObject>
#include <QUrl>
#include <QUrlQuery>
#include <QJsonObject>
#include <QJsonArray>
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
class OcsApi : public QObject
{
Q_OBJECT
public:
explicit OcsApi(const QString &id = "", const QUrl &baseUrl = QUrl(), const QString &userName = "", const QString &password = "", QObject *parent = 0);
OcsApi(const OcsApi &other, QObject *parent = 0);
OcsApi &operator =(const OcsApi &other);
QString id() const;
void setId(const QString &id);
QUrl baseUrl() const;
void setBaseUrl(const QUrl &baseUrl);
QString userName() const;
void setUserName(const QString &userName);
QString password() const;
void setPassword(const QString &password);
QJsonObject getConfig();
QJsonObject checkPerson();
QJsonObject getPersonDataSet(const QUrlQuery &query = QUrlQuery());
QJsonObject getPersonData(const QString &personId);
QJsonObject getPersonSelf();
QJsonObject getContentCategories();
QJsonObject getContentDataSet(const QUrlQuery &query = QUrlQuery());
QJsonObject getContentData(const QString &contentId);
QJsonObject getContentDownload(const QString &contentId, const QString &itemId);
static QJsonArray getProviderFile(const QUrl &url);
private:
QString id_;
QUrl baseUrl_;
QString userName_;
QString password_;
};