Changeset View
Changeset View
Standalone View
Standalone View
src/core/job.h
Show All 21 Lines | |||||
22 | 22 | | |||
23 | #ifndef LIBKGAPI2_JOB_H | 23 | #ifndef LIBKGAPI2_JOB_H | ||
24 | #define LIBKGAPI2_JOB_H | 24 | #define LIBKGAPI2_JOB_H | ||
25 | 25 | | |||
26 | #include "types.h" | 26 | #include "types.h" | ||
27 | #include "kgapicore_export.h" | 27 | #include "kgapicore_export.h" | ||
28 | 28 | | |||
29 | #include <QObject> | 29 | #include <QObject> | ||
30 | #include <QUrl> | ||||
30 | 31 | | |||
31 | class QNetworkAccessManager; | 32 | class QNetworkAccessManager; | ||
32 | class QNetworkReply; | 33 | class QNetworkReply; | ||
33 | class QNetworkRequest; | 34 | class QNetworkRequest; | ||
34 | 35 | | |||
35 | namespace KGAPI2 { | 36 | namespace KGAPI2 { | ||
36 | 37 | | |||
37 | /** | 38 | /** | ||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | 83 | public: | |||
92 | * @brief Constructor for jobs that require authentication | 93 | * @brief Constructor for jobs that require authentication | ||
93 | * | 94 | * | ||
94 | * @param account Account to use to authenticate the requests send by this job | 95 | * @param account Account to use to authenticate the requests send by this job | ||
95 | * @param parent | 96 | * @param parent | ||
96 | * @see Job::Account, Job::setAccount | 97 | * @see Job::Account, Job::setAccount | ||
97 | */ | 98 | */ | ||
98 | explicit Job(const AccountPtr &account, QObject* parent = nullptr); | 99 | explicit Job(const AccountPtr &account, QObject* parent = nullptr); | ||
99 | 100 | | |||
101 | struct StandardParams { | ||||
102 | static const QString PrettyPrint; | ||||
103 | }; | ||||
104 | | ||||
100 | /** | 105 | /** | ||
101 | * @brief Destructor | 106 | * @brief Destructor | ||
102 | */ | 107 | */ | ||
103 | ~Job() override; | 108 | ~Job() override; | ||
104 | 109 | | |||
105 | /** | 110 | /** | ||
106 | * @brief Error code | 111 | * @brief Error code | ||
107 | * | 112 | * | ||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | |||||
175 | * For jobs that don't require authentication, this method returns a null | 180 | * For jobs that don't require authentication, this method returns a null | ||
176 | * pointer. | 181 | * pointer. | ||
177 | * | 182 | * | ||
178 | * @return Am Account or a null pointer when no account was set. | 183 | * @return Am Account or a null pointer when no account was set. | ||
179 | */ | 184 | */ | ||
180 | AccountPtr account() const; | 185 | AccountPtr account() const; | ||
181 | 186 | | |||
182 | /** | 187 | /** | ||
188 | * @brief Sets whether response will have indentations and line breaks. | ||||
189 | * | ||||
190 | * When this is false, it can reduce the response payload size, | ||||
191 | * which might lead to better performance in some environments. | ||||
192 | * Default is false. | ||||
193 | * | ||||
194 | * @param prettyPrint | ||||
195 | */ | ||||
196 | void setPrettyPrint(bool prettyPrint); | ||||
197 | | ||||
198 | /** | ||||
199 | * @brief Returns prettyPrint query parameter. | ||||
200 | * | ||||
201 | * @return prettyPrint query parameter | ||||
202 | */ | ||||
203 | bool prettyPrint() const; | ||||
204 | | ||||
205 | /** | ||||
183 | * @brief Restarts this job | 206 | * @brief Restarts this job | ||
184 | * | 207 | * | ||
185 | * When a job finishes, it's possible to run it again, without having | 208 | * When a job finishes, it's possible to run it again, without having | ||
186 | * to create a new job. | 209 | * to create a new job. | ||
187 | * | 210 | * | ||
188 | * The job will throw away all results retrieved in previous run and retrieve | 211 | * The job will throw away all results retrieved in previous run and retrieve | ||
189 | * everything again. | 212 | * everything again. | ||
190 | * | 213 | * | ||
▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines |