Kgapi

about.h
1/*
2 SPDX-FileCopyrightText: 2012 Andrius da Costa Ribas <andriusmao@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#pragma once
8
9#include "kgapidrive_export.h"
10#include "object.h"
11#include "types.h"
12
13#include <QSharedPointer>
14#include <QString>
15#include <QStringList>
16#include <QUrl>
17
18namespace KGAPI2
19{
20
21namespace Drive
22{
23
24/**
25 * @brief DriveAbout contains information about the current user along with
26 * Google Drive API settings.
27 *
28 * Getters and setters' documentation is based on Google Drive's API v2 reference
29 * @see <a href="https://developers.google.com/drive/v2/reference/about">About</a>
30 *
31 * @since 2.0
32 * @author Andrius da Costa Ribas <andriusmao@gmail.com>
33 * @author Daniel Vrátil <dvratil@redhat.com>
34 */
35class KGAPIDRIVE_EXPORT About : public KGAPI2::Object
36{
37public:
38 /**
39 * @brief DriveAbout::Format holds the structure used for importFormats[]
40 * and exportFormats[] properties.
41 */
42 class Format
43 {
44 public:
45 explicit Format(const Format &other);
46 virtual ~Format();
47 bool operator==(const Format &other) const;
48 bool operator!=(const Format &other) const
49 {
50 return !operator==(other);
51 }
52
53 /**
54 * @brief Returns the content type to convert from.
55 */
56 QString source() const;
57
58 /**
59 * @brief Returns the possible content types to convert to.
60 */
61 QStringList targets() const;
62
63 private:
64 explicit Format();
65
66 class Private;
67 Private *const d;
68 friend class Private;
69 friend class About;
70 };
71
74
75 /**
76 * @brief DriveAbout::AdditionalRoleInfo holds the structure used for
77 * additionalRoleInfo[] property.
78 */
80 {
81 public:
82 /**
83 * @brief DriveAbout::AdditionalRoleInfo::Role holds the structure used for
84 * additionalRoleInfo[].roleSets[] property.
85 */
86 class RoleSet
87 {
88 public:
89 explicit RoleSet(const RoleSet &other);
90 virtual ~RoleSet();
91 bool operator==(const RoleSet &other) const;
92 bool operator!=(const RoleSet &other) const
93 {
94 return !operator==(other);
95 }
96
97 /**
98 * @brief Returns the primary permission role.
99 */
101
102 /**
103 * @brief Returns the supported additional roles with the primary role.
104 */
106
107 private:
108 explicit RoleSet();
109
110 class Private;
111 Private *const d;
112 friend class Private;
113 friend class About;
114 };
115
118
119 explicit AdditionalRoleInfo(const AdditionalRoleInfo &other);
120 virtual ~AdditionalRoleInfo();
121 bool operator==(const AdditionalRoleInfo &other) const;
122 bool operator!=(const AdditionalRoleInfo &other) const
123 {
124 return !operator==(other);
125 }
126
127 /**
128 * @brief Returns the content type that this additional role info applies to.
129 */
130 [[nodiscard]] QString type() const;
131
132 /**
133 * @brief Returns the supported additional roles per primary role.
134 */
135 [[nodiscard]] RoleSetsList roleSets() const;
136
137 private:
138 explicit AdditionalRoleInfo();
139
140 class Private;
141 Private *const d;
142 friend class Private;
143 friend class About;
144 };
145
148
149 /**
150 * @brief DriveAbout::Feature holds the structure used for features[] property.
151 */
153 {
154 public:
155 explicit Feature(const Feature &other);
156 virtual ~Feature();
157 bool operator==(const Feature &other) const;
158 bool operator!=(const Feature &other) const
159 {
160 return !operator==(other);
161 }
162
163 /**
164 * @brief Returns the name of the feature.
165 */
166 QString featureName() const;
167
168 /**
169 * @brief Returns the request limit rate for this feature, in queries per second.
170 */
171 qreal featureRate() const;
172
173 private:
174 explicit Feature();
175
176 class Private;
177 Private *const d;
178 friend class Private;
179 friend class About;
180 };
181
184
185 /**
186 * @brief DriveAbout::MaxUploadSize holds the structure used for maxUploadSizes[] property.
187 */
189 {
190 public:
191 explicit MaxUploadSize(const MaxUploadSize &other);
192 virtual ~MaxUploadSize();
193 bool operator==(const MaxUploadSize &other) const;
194 bool operator!=(const MaxUploadSize &other) const
195 {
196 return !operator==(other);
197 }
198
199 /**
200 * @brief Returns the file type.
201 */
202 QString type() const;
203
204 /**
205 * @brief Returns the max upload size for this type.
206 */
207 qlonglong size() const;
208
209 private:
210 explicit MaxUploadSize();
211
212 class Private;
213 Private *const d;
214 friend class Private;
215 friend class About;
216 };
217
220
221 struct KGAPIDRIVE_EXPORT Fields {
222 static const QString AdditionalRoleInfo;
223 static const QString AdditionalRoles;
224 static const QString BackgroundImageLink;
225 static const QString BytesUsed;
226 static const QString CanCreateDrives;
227 static const QString ColorRgb;
228 static const QString DisplayName;
229 static const QString DomainSharingPolicy;
230 static const QString EmailAddress;
231 static const QString Etag;
232 static const QString ExportFormats;
233 static const QString FeatureName;
234 static const QString FeatureRate;
235 static const QString Features;
236 static const QString FolderColorPalette;
237 static const QString Id;
238 static const QString ImportFormats;
239 static const QString IsAuthenticatedUser;
240 static const QString IsCurrentAppInstalled;
241 static const QString Kind;
242 static const QString LanguageCode;
243 static const QString LargestChangeId;
244 static const QString MaxUploadSizes;
245 static const QString Name;
246 static const QString PermissionId;
247 static const QString Picture;
248 static const QString PrimaryRole;
249 static const QString QuotaBytesByService;
250 static const QString QuotaBytesTotal;
251 static const QString QuotaBytesUsed;
252 static const QString QuotaBytesUsedAggregate;
253 static const QString QuotaBytesUsedInTrash;
254 static const QString QuotaType;
255 static const QString RemainingChangeIds;
256 static const QString RoleSets;
257 static const QString RootFolderId;
258 static const QString SelfLink;
259 static const QString ServiceName;
260 static const QString Size;
261 static const QString Source;
262 static const QString Targets;
263 static const QString TeamDriveThemes;
264 static const QString Type;
265 static const QString Url;
266 static const QString User;
267 };
268
269 About(const About &other);
270 ~About() override;
271
272 bool operator==(const About &other) const;
273 bool operator!=(const About &other) const
274 {
275 return !operator==(other);
276 }
277
278 /**
279 * @brief Returns the link back to this item.
280 */
281 QUrl selfLink() const;
282
283 /**
284 * @brief Returns the name of the current user.
285 */
286 QString name() const;
287
288 /**
289 * @brief Returns the total number of quota bytes.
290 */
291 qlonglong quotaBytesTotal() const;
292
293 /**
294 * @brief Returns the total number of quota bytes used.
295 */
296 qlonglong quotaBytesUsed() const;
297
298 /**
299 * @brief Returns the total number of quota bytes used by trashed items.
300 */
301 qlonglong quotaBytesUsedInTrash() const;
302
303 /**
304 * @brief returns the total number of quota bytes used by all Google apps
305 * (Drive, Picasa, etc.).
306 * @since 5.3.2
307 */
308 qlonglong quotaBytesUsedAggregate() const;
309
310 /**
311 * @brief returns the total number of quota bytes used by all Google apps
312 * (Drive, Picasa, etc.).
313 * @deprecated since 5.3.2, use quotaBytesUsedAggregate() instead.
314 */
315#ifndef KGAPIDRIVE_NO_DEPRECATED
316 KGAPIDRIVE_DEPRECATED qlonglong quotaBytesUserAggregate() const;
317#endif
318
319 /**
320 * @brief Returns the largest change id.
321 */
322 qlonglong largestChangeId() const;
323
324 /**
325 * @brief Returns the number of remaining change ids.
326 */
327 qlonglong remainingChangeIds() const;
328
329 /**
330 * @brief Returns the id of the root folder.
331 */
333
334 /**
335 * @brief Returns the domain sharing policy for the current user.
336 */
338
339 /**
340 * @brief Returns the allowable import formats.
341 */
343
344 /**
345 * @brief Returns the allowable export formats.
346 */
348
349 /**
350 * @brief Returns information about supported additional roles per file type.
351 *
352 * The most specific type takes precedence.
353 */
355
356 /**
357 * @brief Returns the list of additional features enabled on this account.
358 */
360
361 /**
362 * @brief Returns the list of max upload sizes for each file type.
363 *
364 * The most specific type takes precedence.
365 */
367
368 /**
369 * @brief Returns the current user's ID as visible in the permissions collection.
370 */
372
373 /**
374 * @brief Returns whether the authenticated app is installed by the authenticated user.
375 */
377
378 /**
379 * @brief Returns the authenticated user.
380 */
381 UserPtr user() const;
382
383 /**
384 * @brief Returns whether the user can create shared drives.
385 */
386 bool canCreateDrives() const;
387
388 /**
389 * @brief Constructs a new DriveAbout object from given JSON data
390 *
391 * @param jsonData
392 */
393 static AboutPtr fromJSON(const QByteArray &jsonData);
394
395private:
396 About();
397
398 class Private;
400 friend class Private;
401};
402
403} /* namespace Drive */
404
405} /* namespace KGAPI2 */
DriveAbout::AdditionalRoleInfo::Role holds the structure used for additionalRoleInfo[]....
Definition about.h:87
QStringList additionalRoles() const
Returns the supported additional roles with the primary role.
QString primaryRole() const
Returns the primary permission role.
DriveAbout::AdditionalRoleInfo holds the structure used for additionalRoleInfo[] property.
Definition about.h:80
QString type() const
Returns the content type that this additional role info applies to.
RoleSetsList roleSets() const
Returns the supported additional roles per primary role.
DriveAbout::Feature holds the structure used for features[] property.
Definition about.h:153
DriveAbout::Format holds the structure used for importFormats[] and exportFormats[] properties.
Definition about.h:43
DriveAbout::MaxUploadSize holds the structure used for maxUploadSizes[] property.
Definition about.h:189
DriveAbout contains information about the current user along with Google Drive API settings.
Definition about.h:36
QString domainSharingPolicy() const
Returns the domain sharing policy for the current user.
KGAPIDRIVE_DEPRECATED qlonglong quotaBytesUserAggregate() const
returns the total number of quota bytes used by all Google apps (Drive, Picasa, etc....
FeaturesList features() const
Returns the list of additional features enabled on this account.
MaxUploadSizesList maxUploadSizes() const
Returns the list of max upload sizes for each file type.
FormatsList importFormats() const
Returns the allowable import formats.
qlonglong largestChangeId() const
Returns the largest change id.
static AboutPtr fromJSON(const QByteArray &jsonData)
Constructs a new DriveAbout object from given JSON data.
qlonglong remainingChangeIds() const
Returns the number of remaining change ids.
QString name() const
Returns the name of the current user.
qlonglong quotaBytesUsedAggregate() const
returns the total number of quota bytes used by all Google apps (Drive, Picasa, etc....
UserPtr user() const
Returns the authenticated user.
qlonglong quotaBytesTotal() const
Returns the total number of quota bytes.
AdditionalRoleInfosList additionalRoleInfo() const
Returns information about supported additional roles per file type.
qlonglong quotaBytesUsed() const
Returns the total number of quota bytes used.
QString rootFolderId() const
Returns the id of the root folder.
bool isCurrentAppInstalled() const
Returns whether the authenticated app is installed by the authenticated user.
QUrl selfLink() const
Returns the link back to this item.
bool canCreateDrives() const
Returns whether the user can create shared drives.
FormatsList exportFormats() const
Returns the allowable export formats.
QString permissionId() const
Returns the current user's ID as visible in the permissions collection.
qlonglong quotaBytesUsedInTrash() const
Returns the total number of quota bytes used by trashed items.
The authenticated user.
Definition user.h:27
Base class for all objects.
Definition object.h:31
A job to fetch a single map tile described by a StaticMapUrl.
Definition blog.h:16
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.