Kgapi

types.h
1 /*
2  * This file is part of LibKGAPI library
3  *
4  * Copyright (C) 2013 Daniel Vrátil <[email protected]>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) version 3, or any
10  * later version accepted by the membership of KDE e.V. (or its
11  * successor approved by the membership of KDE e.V.), which shall
12  * act as a proxy defined in Section 6 of version 3 of the license.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library. If not, see <https://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef LIBKGAPI2_TYPES_H
24 #define LIBKGAPI2_TYPES_H
25 
26 #include "kgapicore_export.h"
27 
28 #include <QSharedPointer>
29 #include <QList>
30 #include <QUrl>
31 
32 namespace KGAPI2
33 {
34 
38 class KGAPICORE_EXPORT FeedData {
39 
40  public:
41  explicit FeedData():
42  startIndex(0),
43  itemsPerPage(0),
44  totalResults(0)
45  { }
46 
47  int startIndex;
58 };
59 
60 
61 class Object;
64 
65 class Account;
68 
69 class AccountInfo;
72 
73 class Contact;
76 
77 class ContactsGroup;
80 
81 class Calendar;
84 
85 namespace Drive
86 {
87 
88 class About;
89 typedef QSharedPointer<About> AboutPtr;
90 typedef QList<AboutPtr> AboutsList;
91 
92 class App;
93 typedef QSharedPointer<App> AppPtr;
94 typedef QList<AppPtr> AppsList;
95 
96 class Change;
97 typedef QSharedPointer<Change> ChangePtr;
98 typedef QList<ChangePtr> ChangesList;
99 
100 class ChildReference;
101 typedef QSharedPointer<ChildReference> ChildReferencePtr;
102 typedef QList<ChildReferencePtr> ChildReferencesList;
103 
104 class File;
105 typedef QSharedPointer<File> FilePtr;
106 typedef QList<FilePtr> FilesList;
107 
108 class ParentReference;
109 typedef QSharedPointer<ParentReference> ParentReferencePtr;
110 typedef QList<ParentReferencePtr> ParentReferencesList;
111 
112 class Permission;
113 typedef QSharedPointer<Permission> PermissionPtr;
114 typedef QList<PermissionPtr> PermissionsList;
115 
116 class Revision;
117 typedef QSharedPointer<Revision> RevisionPtr;
118 typedef QList<RevisionPtr> RevisionsList;
119 
120 class Drives;
121 typedef QSharedPointer<Drives> DrivesPtr;
122 typedef QList<DrivesPtr> DrivesList;
123 
124 class Teamdrive;
125 typedef QSharedPointer<Teamdrive> TeamdrivePtr;
126 typedef QList<TeamdrivePtr> TeamdrivesList;
127 
128 class User;
129 typedef QSharedPointer<User> UserPtr;
130 typedef QList<UserPtr> UsersList;
131 
132 }
133 
134 class Event;
137 
138 class Location;
141 
142 class Reminder;
145 
146 class Task;
148 typedef QList<TaskPtr> TasksList;
149 
150 class TaskList;
153 
154 namespace Blogger
155 {
156 class Blog;
157 typedef QSharedPointer<Blog> BlogPtr;
158 typedef QList<BlogPtr> BlogsList;
159 
160 class Comment;
161 typedef QSharedPointer<Comment> CommentPtr;
162 typedef QList<CommentPtr> CommentsList;
163 
164 class Page;
165 typedef QSharedPointer<Page> PagePtr;
166 typedef QList<PagePtr> PagesList;
167 
168 class Post;
169 typedef QSharedPointer<Post> PostPtr;
170 typedef QList<PostPtr> PostsList;
171 
172 }
173 
174 template<class T>
175 ObjectsList operator<<(ObjectsList &objectsList, const QList< QSharedPointer<T> > &list)
176 {
177  for (const QSharedPointer<T> &item : list) {
178  objectsList << item;
179  }
180 
181  return objectsList;
182 }
183 
187 enum Error {
188  /* Internal LibKGAPI errors */
189  NoError = 0,
191  AuthError = 2,
199 
200  /* Following error codes identify Google errors */
201  OK = 200,
202  Created = 201,
203  NoContent = 204,
205  NotModified = 304,
206  BadRequest = 400,
207  Unauthorized = 401,
208  Forbidden = 403,
209  NotFound = 404,
210  Conflict = 409,
211  Gone = 410,
214 };
215 
220  UnknownContentType = -1,
221  JSON,
222  XML
223 };
224 
225 } // namespace KGAPI2
226 
227 
228 
229 #endif // LIBKGAPI2_TYPES_H
Object on the remote site differs from the submitted one.
Definition: types.h:210
LibKGAPI error - no error.
Definition: types.h:189
Base class for all objects.
Definition: object.h:45
int itemsPerPage
Number of items per feed page.
Definition: types.h:48
Requested object was not found on the remote side.
Definition: types.h:209
An unexpected error occurred on the Google service.
Definition: types.h:212
Invalid or expired token. See KGAPI2::Account::refreshTokens().
Definition: types.h:207
Represents a tasklist for Google Tasks service.
Definition: tasklist.h:40
QUrl nextPageUrl
Link to next page of feed.
Definition: types.h:52
Error
Job error codes.
Definition: types.h:187
Structure to store additional information about a feed.
Definition: types.h:38
Request successfully executed.
Definition: types.h:201
Request was successful, but no data were updated.
Definition: types.h:205
Represents a contacts group.
Definition: contactsgroup.h:48
Comment
The requested data is not accessible to this account.
Definition: types.h:208
LibKGAPI error - the KGAPI2::Account object is invalid.
Definition: types.h:196
Represents a single contact.
Definition: contact.h:42
A job to fetch a single map tile described by a StaticMapUrl.
Definition: blog.h:30
The requested data does not exist anymore on the remote site.
Definition: types.h:211
User quota has been exceeded, the request should be sent again later.
Definition: types.h:213
LibKGAPI error - application requested unknown account.
Definition: types.h:192
Represents a single event from Google Calendar.
Definition: event.h:43
Represents a default calendar reminder.
Definition: reminder.h:44
LibKGAPI error - a general unidentified error.
Definition: types.h:190
LibKGAPI error - application requested unknown service.
Definition: types.h:193
LibKGAPI error - when the authentication dialog is canceled.
Definition: types.h:198
Represents a single task (or todo)
Definition: task.h:41
LibKGAPI error - Google returned invalid response.
Definition: types.h:194
Create request successfully executed.
Definition: types.h:202
QString syncToken
Sync token that can be used for incremental updates by some of the services.
Definition: types.h:56
LibKGAPI error - standard network request returned a different code than 200.
Definition: types.h:197
Tasks API returns 204 when task is successfully removed.
Definition: types.h:203
AccountInfo contains information about user&#39;s Google account.
Definition: accountinfo.h:46
int totalResults
Number of all items.
Definition: types.h:51
A Google account.
Definition: account.h:54
The object is located on a different URL provided in reply.
Definition: types.h:204
LibKGAPI error - authentication process failed.
Definition: types.h:191
An object that represents a Google calendar.
Definition: calendar.h:42
QUrl requestUrl
Original URL of the request.
Definition: types.h:53
int startIndex
Index of first item on current feed page.
Definition: types.h:47
Invalid (malformed) request.
Definition: types.h:206
Represents a single record about geographical location provided by Google Latitude service...
Definition: location.h:43
ContentType
Definition: types.h:219
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue May 26 2020 22:38:58 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.