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 typedef QSharedPointer<About> AboutPtr;
76 typedef QList<AboutPtr> AboutsList;
77 
78 class App;
79 typedef QSharedPointer<App> AppPtr;
80 typedef QList<AppPtr> AppsList;
81 
82 class Change;
83 typedef QSharedPointer<Change> ChangePtr;
84 typedef QList<ChangePtr> ChangesList;
85 
86 class ChildReference;
87 typedef QSharedPointer<ChildReference> ChildReferencePtr;
88 typedef QList<ChildReferencePtr> ChildReferencesList;
89 
90 class File;
91 typedef QSharedPointer<File> FilePtr;
92 typedef QList<FilePtr> FilesList;
93 
94 class ParentReference;
95 typedef QSharedPointer<ParentReference> ParentReferencePtr;
96 typedef QList<ParentReferencePtr> ParentReferencesList;
97 
98 class Permission;
99 typedef QSharedPointer<Permission> PermissionPtr;
100 typedef QList<PermissionPtr> PermissionsList;
101 
102 class Revision;
103 typedef QSharedPointer<Revision> RevisionPtr;
104 typedef QList<RevisionPtr> RevisionsList;
105 
106 class Drives;
107 typedef QSharedPointer<Drives> DrivesPtr;
108 typedef QList<DrivesPtr> DrivesList;
109 
110 class Teamdrive;
111 typedef QSharedPointer<Teamdrive> TeamdrivePtr;
112 typedef QList<TeamdrivePtr> TeamdrivesList;
113 
114 class User;
115 typedef QSharedPointer<User> UserPtr;
116 typedef QList<UserPtr> UsersList;
117 
118 }
119 
120 class Event;
123 
124 class Location;
127 
128 class Reminder;
131 
132 class Task;
134 typedef QList<TaskPtr> TasksList;
135 
136 class TaskList;
139 
140 namespace Blogger
141 {
142 class Blog;
143 typedef QSharedPointer<Blog> BlogPtr;
144 typedef QList<BlogPtr> BlogsList;
145 
146 class Comment;
147 typedef QSharedPointer<Comment> CommentPtr;
148 typedef QList<CommentPtr> CommentsList;
149 
150 class Page;
151 typedef QSharedPointer<Page> PagePtr;
152 typedef QList<PagePtr> PagesList;
153 
154 class Post;
155 typedef QSharedPointer<Post> PostPtr;
156 typedef QList<PostPtr> PostsList;
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,
191  NotModified = 304,
192  BadRequest = 400,
193  Unauthorized = 401,
194  Forbidden = 403,
195  NotFound = 404,
196  Conflict = 409,
197  Gone = 410,
200 };
201 
206  UnknownContentType = -1,
207  JSON,
208  XML
209 };
210 
211 } // namespace KGAPI2
212 
213 
214 
215 #endif // LIBKGAPI2_TYPES_H
Object on the remote site differs from the submitted one.
Definition: types.h:196
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:195
An unexpected error occurred on the Google service.
Definition: types.h:198
Invalid or expired token. See KGAPI2::Account::refreshTokens().
Definition: types.h:193
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:191
Represents a contacts group.
Definition: contactsgroup.h:34
Comment
The requested data is not accessible to this account.
Definition: types.h:194
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:197
User quota has been exceeded, the request should be sent again later.
Definition: types.h:199
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
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:190
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:192
Represents a single record about geographical location provided by Google Latitude service...
Definition: location.h:29
ContentType
Definition: types.h:205
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Aug 4 2020 23:08:49 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.