Kgapi

types.h
1 /*
2  * This file is part of LibKGAPI library
3  *
4  * SPDX-FileCopyrightText: 2013 Daniel Vrátil <[email protected]>
5  *
6  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7  */
8 
9 #ifndef LIBKGAPI2_TYPES_H
10 #define LIBKGAPI2_TYPES_H
11 
12 #include "kgapicore_export.h"
13 
14 #include <QSharedPointer>
15 #include <QList>
16 #include <QUrl>
17 
18 namespace KGAPI2
19 {
20 
24 class KGAPICORE_EXPORT FeedData {
25 
26  public:
27  explicit FeedData():
28  startIndex(0),
29  itemsPerPage(0),
30  totalResults(0)
31  { }
32 
33  int startIndex;
44 };
45 
46 
47 class Object;
50 
51 class Account;
54 
55 class AccountInfo;
58 
59 class Contact;
62 
63 class ContactsGroup;
66 
67 class Calendar;
70 
71 namespace Drive
72 {
73 
74 class About;
75 using AboutPtr = QSharedPointer<About>;
76 using AboutsList = QList<AboutPtr>;
77 
78 class App;
79 using AppPtr = QSharedPointer<App>;
80 using AppsList = QList<AppPtr>;
81 
82 class Change;
83 using ChangePtr = QSharedPointer<Change>;
84 using ChangesList = QList<ChangePtr>;
85 
86 class ChildReference;
87 using ChildReferencePtr = QSharedPointer<ChildReference>;
88 using ChildReferencesList = QList<ChildReferencePtr>;
89 
90 class File;
91 using FilePtr = QSharedPointer<File>;
92 using FilesList = QList<FilePtr>;
93 
94 class ParentReference;
95 using ParentReferencePtr = QSharedPointer<ParentReference>;
96 using ParentReferencesList = QList<ParentReferencePtr>;
97 
98 class Permission;
99 using PermissionPtr = QSharedPointer<Permission>;
100 using PermissionsList = QList<PermissionPtr>;
101 
102 class Revision;
103 using RevisionPtr = QSharedPointer<Revision>;
104 using RevisionsList = QList<RevisionPtr>;
105 
106 class Drives;
107 using DrivesPtr = QSharedPointer<Drives>;
108 using DrivesList = QList<DrivesPtr>;
109 
110 class Teamdrive;
111 using TeamdrivePtr = QSharedPointer<Teamdrive>;
112 using TeamdrivesList = QList<TeamdrivePtr>;
113 
114 class User;
115 using UserPtr = QSharedPointer<User>;
116 using UsersList = QList<UserPtr>;
117 
118 }
119 
120 class Event;
123 
124 class Location;
127 
128 class Reminder;
131 
132 class Task;
134 using TasksList = QList<TaskPtr>;
135 
136 class TaskList;
139 
140 namespace Blogger
141 {
142 class Blog;
143 using BlogPtr = QSharedPointer<Blog>;
144 using BlogsList = QList<BlogPtr>;
145 
146 class Comment;
147 using CommentPtr = QSharedPointer<Comment>;
148 using CommentsList = QList<CommentPtr>;
149 
150 class Page;
151 using PagePtr = QSharedPointer<Page>;
152 using PagesList = QList<PagePtr>;
153 
154 class Post;
155 using PostPtr = QSharedPointer<Post>;
156 using PostsList = QList<PostPtr>;
157 
158 }
159 
160 template<class T>
161 ObjectsList operator<<(ObjectsList &objectsList, const QList< QSharedPointer<T> > &list)
162 {
163  for (const QSharedPointer<T> &item : list) {
164  objectsList << item;
165  }
166 
167  return objectsList;
168 }
169 
173 enum Error {
174  /* Internal LibKGAPI errors */
175  NoError = 0,
177  AuthError = 2,
185 
186  /* Following error codes identify Google errors */
187  OK = 200,
188  Created = 201,
189  NoContent = 204,
192  NotModified = 304,
194  BadRequest = 400,
195  Unauthorized = 401,
196  Forbidden = 403,
197  NotFound = 404,
198  Conflict = 409,
199  Gone = 410,
202 };
203 
208  UnknownContentType = -1,
209  JSON,
210  XML
211 };
212 
213 } // namespace KGAPI2
214 
215 
216 
217 #endif // LIBKGAPI2_TYPES_H
Object on the remote site differs from the submitted one.
Definition: types.h:198
LibKGAPI error - no error.
Definition: types.h:175
Base class for all objects.
Definition: object.h:31
int itemsPerPage
Number of items per feed page.
Definition: types.h:34
Requested object was not found on the remote side.
Definition: types.h:197
Drive Api returns 308 when accepting a partial file upload.
Definition: types.h:190
An unexpected error occurred on the Google service.
Definition: types.h:200
Invalid or expired token. See KGAPI2::Account::refreshTokens().
Definition: types.h:195
Represents a tasklist for Google Tasks service.
Definition: tasklist.h:28
QUrl nextPageUrl
Link to next page of feed.
Definition: types.h:38
Error
Job error codes.
Definition: types.h:173
Structure to store additional information about a feed.
Definition: types.h:24
Request successfully executed.
Definition: types.h:187
Request was successful, but no data were updated.
Definition: types.h:192
Represents a contacts group.
Definition: contactsgroup.h:34
Comment
The requested data is not accessible to this account.
Definition: types.h:196
LibKGAPI error - the KGAPI2::Account object is invalid.
Definition: types.h:182
Represents a single contact.
Definition: contact.h:28
A job to fetch a single map tile described by a StaticMapUrl.
Definition: blog.h:16
The requested data does not exist anymore on the remote site.
Definition: types.h:199
User quota has been exceeded, the request should be sent again later.
Definition: types.h:201
LibKGAPI error - application requested unknown account.
Definition: types.h:178
Represents a single event from Google Calendar.
Definition: event.h:29
Represents a default calendar reminder.
Definition: reminder.h:30
LibKGAPI error - a general unidentified error.
Definition: types.h:176
LibKGAPI error - application requested unknown service.
Definition: types.h:179
LibKGAPI error - when the authentication dialog is canceled.
Definition: types.h:184
Represents a single task (or todo)
Definition: task.h:29
LibKGAPI error - Google returned invalid response.
Definition: types.h:180
Create request successfully executed.
Definition: types.h:188
QString syncToken
Sync token that can be used for incremental updates by some of the services.
Definition: types.h:42
LibKGAPI error - standard network request returned a different code than 200.
Definition: types.h:183
Tasks API returns 204 when task is successfully removed.
Definition: types.h:189
AccountInfo contains information about user&#39;s Google account.
Definition: accountinfo.h:32
The object is located at a different URL provided in the reply. The same request method must be used...
Definition: types.h:193
int totalResults
Number of all items.
Definition: types.h:37
A Google account.
Definition: account.h:40
The object is located on a different URL provided in reply.
Definition: types.h:191
LibKGAPI error - authentication process failed.
Definition: types.h:177
An object that represents a Google calendar.
Definition: calendar.h:28
QUrl requestUrl
Original URL of the request.
Definition: types.h:39
int startIndex
Index of first item on current feed page.
Definition: types.h:33
Invalid (malformed) request.
Definition: types.h:194
Represents a single record about geographical location provided by Google Latitude service...
Definition: location.h:29
ContentType
Definition: types.h:207
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Jan 23 2021 06:37:21 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.