Kgapi

about.h
1 /*
2  Copyright 2012 Andrius da Costa Ribas <[email protected]>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) version 3, or any
8  later version accepted by the membership of KDE e.V. (or its
9  successor approved by the membership of KDE e.V.), which shall
10  act as a proxy defined in Section 6 of version 3 of the license.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public
18  License along with this library. If not, see <https://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef LIBKGAPI2_DRIVE_ABOUT_H
22 #define LIBKGAPI2_DRIVE_ABOUT_H
23 
24 #include "types.h"
25 #include "object.h"
26 #include "kgapidrive_export.h"
27 
28 #include <QString>
29 #include <QStringList>
30 #include <QSharedPointer>
31 #include <QUrl>
32 
33 namespace KGAPI2
34 {
35 
36 namespace Drive
37 {
38 
50 class KGAPIDRIVE_EXPORT About: public KGAPI2::Object
51 {
52 
53 public:
58  class Format
59  {
60  public:
61  explicit Format(const Format &other);
62  virtual ~Format();
63  bool operator==(const Format &other) const;
64  bool operator!=(const Format &other) const { return !operator==(other); }
65 
69  QString source() const;
70 
74  QStringList targets() const;
75 
76  private:
77  explicit Format();
78 
79  class Private;
80  Private *const d;
81  friend class Private;
82  friend class About;
83  };
84 
87 
93  {
94  public:
95 
100  class RoleSet
101  {
102  public:
103  explicit RoleSet(const RoleSet &other);
104  virtual ~RoleSet();
105  bool operator==(const RoleSet &other) const;
106  bool operator!=(const RoleSet &other) const { return !operator==(other); }
107 
111  QString primaryRole() const;
112 
116  QStringList additionalRoles() const;
117 
118  private:
119  explicit RoleSet();
120 
121  class Private;
122  Private *const d;
123  friend class Private;
124  friend class About;
125  };
126 
129 
130  explicit AdditionalRoleInfo(const AdditionalRoleInfo &other);
131  virtual ~AdditionalRoleInfo();
132  bool operator==(const AdditionalRoleInfo &other) const;
133  bool operator!=(const AdditionalRoleInfo &other) const { return !operator==(other); }
134 
138  QString type() const;
139 
143  RoleSetsList roleSets() const;
144 
145  private:
146  explicit AdditionalRoleInfo();
147 
148  class Private;
149  Private *const d;
150  friend class Private;
151  friend class About;
152  };
153 
156 
160  class Feature
161  {
162  public:
163  explicit Feature(const Feature &other);
164  virtual ~Feature();
165  bool operator==(const Feature &other) const;
166  bool operator!=(const Feature &other) const { return !operator==(other); }
167 
171  QString featureName() const;
172 
176  qreal featureRate() const;
177 
178  private:
179  explicit Feature();
180 
181  class Private;
182  Private *const d;
183  friend class Private;
184  friend class About;
185  };
186 
189 
194  {
195  public:
196  explicit MaxUploadSize(const MaxUploadSize &other);
197  virtual ~MaxUploadSize();
198  bool operator==(const MaxUploadSize &other) const;
199  bool operator!=(const MaxUploadSize &other) const { return !operator==(other); }
200 
204  QString type() const;
205 
209  qlonglong size() const;
210 
211 
212  private:
213  explicit MaxUploadSize();
214 
215  class Private;
216  Private *const d;
217  friend class Private;
218  friend class About;
219  };
220 
223 
224  struct KGAPIDRIVE_EXPORT Fields {
225  static const QString AdditionalRoleInfo;
226  static const QString AdditionalRoles;
227  static const QString BackgroundImageLink;
228  static const QString BytesUsed;
229  static const QString CanCreateDrives;
230  static const QString ColorRgb;
231  static const QString DisplayName;
232  static const QString DomainSharingPolicy;
233  static const QString EmailAddress;
234  static const QString Etag;
235  static const QString ExportFormats;
236  static const QString FeatureName;
237  static const QString FeatureRate;
238  static const QString Features;
239  static const QString FolderColorPalette;
240  static const QString Id;
241  static const QString ImportFormats;
242  static const QString IsAuthenticatedUser;
243  static const QString IsCurrentAppInstalled;
244  static const QString Kind;
245  static const QString LanguageCode;
246  static const QString LargestChangeId;
247  static const QString MaxUploadSizes;
248  static const QString Name;
249  static const QString PermissionId;
250  static const QString Picture;
251  static const QString PrimaryRole;
252  static const QString QuotaBytesByService;
253  static const QString QuotaBytesTotal;
254  static const QString QuotaBytesUsed;
255  static const QString QuotaBytesUsedAggregate;
256  static const QString QuotaBytesUsedInTrash;
257  static const QString QuotaType;
258  static const QString RemainingChangeIds;
259  static const QString RoleSets;
260  static const QString RootFolderId;
261  static const QString SelfLink;
262  static const QString ServiceName;
263  static const QString Size;
264  static const QString Source;
265  static const QString Targets;
266  static const QString TeamDriveThemes;
267  static const QString Type;
268  static const QString Url;
269  static const QString User;
270  };
271 
272  About(const About &other);
273  ~About() override;
274 
275  bool operator==(const About &other) const;
276  bool operator!=(const About &other) const { return !operator==(other); }
277 
281  QUrl selfLink() const;
282 
286  QString name() const;
287 
291  qlonglong quotaBytesTotal() const;
292 
296  qlonglong quotaBytesUsed() const;
297 
301  qlonglong quotaBytesUsedInTrash() const;
302 
308  qlonglong quotaBytesUsedAggregate() const;
309 
315 #ifndef KGAPIDRIVE_NO_DEPRECATED
316  KGAPIDRIVE_DEPRECATED qlonglong quotaBytesUserAggregate() const;
317 #endif
318 
322  qlonglong largestChangeId() const;
323 
327  qlonglong remainingChangeIds() const;
328 
332  QString rootFolderId() const;
333 
337  QString domainSharingPolicy() const;
338 
342  FormatsList importFormats() const;
343 
347  FormatsList exportFormats() const;
348 
354  AdditionalRoleInfosList additionalRoleInfo() const;
355 
359  FeaturesList features() const;
360 
366  MaxUploadSizesList maxUploadSizes() const;
367 
371  QString permissionId() const;
372 
376  bool isCurrentAppInstalled() const;
377 
381  UserPtr user() const;
382 
386  bool canCreateDrives() const;
387 
393  static AboutPtr fromJSON(const QByteArray &jsonData);
394 
395  private:
396  About();
397 
398  class Private;
399  QScopedPointer<Private> const d;
400  friend class Private;
401 };
402 
403 } /* namespace Drive */
404 
405 } /* namespace KGAPI2 */
406 
407 #endif // LIBKGAPI2_DRIVE_ABOUT_H
Base class for all objects.
Definition: object.h:45
The authenticated user.
Definition: user.h:41
DriveAbout::MaxUploadSize holds the structure used for maxUploadSizes[] property. ...
Definition: about.h:193
DriveAbout::Format holds the structure used for importFormats[] and exportFormats[] properties...
Definition: about.h:58
DriveAbout::AdditionalRoleInfo::Role holds the structure used for additionalRoleInfo[].roleSets[] property.
Definition: about.h:100
A job to fetch a single map tile described by a StaticMapUrl.
Definition: blog.h:30
DriveAbout::AdditionalRoleInfo holds the structure used for additionalRoleInfo[] property.
Definition: about.h:92
DriveAbout::Feature holds the structure used for features[] property.
Definition: about.h:160
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jun 6 2020 23:01:16 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.