Changeset View
Changeset View
Standalone View
Standalone View
resources/google-groupware/googleresourcestate.cpp
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | Copyright (c) 2020 Igor Poboiko <igor.poboiko@gmail.com> | ||||
3 | | ||||
4 | This library is free software; you can redistribute it and/or modify it | ||||
5 | under the terms of the GNU Library General Public License as published by | ||||
6 | the Free Software Foundation; either version 2 of the License, or (at your | ||||
7 | option) any later version. | ||||
8 | | ||||
9 | This library is distributed in the hope that it will be useful, but WITHOUT | ||||
10 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||||
11 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public | ||||
12 | License for more details. | ||||
13 | | ||||
14 | You should have received a copy of the GNU Library General Public License | ||||
15 | along with this library; see the file COPYING.LIB. If not, write to the | ||||
16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||||
17 | 02110-1301, USA. | ||||
18 | */ | ||||
19 | | ||||
20 | #include "googleresourcestate.h" | ||||
21 | #include "googleresource.h" | ||||
22 | | ||||
23 | using namespace Akonadi; | ||||
24 | | ||||
25 | GoogleResourceState::GoogleResourceState(GoogleResource *resource) | ||||
26 | : m_resource(resource) | ||||
27 | { | ||||
28 | } | ||||
29 | | ||||
30 | // Items handling | ||||
31 | void GoogleResourceState::itemRetrieved(const Item &item) | ||||
32 | { | ||||
33 | m_resource->itemRetrieved(item); | ||||
34 | } | ||||
35 | | ||||
36 | void GoogleResourceState::itemsRetrieved(const Item::List &items) | ||||
37 | { | ||||
38 | m_resource->itemsRetrieved(items); | ||||
39 | } | ||||
40 | | ||||
41 | void GoogleResourceState::itemsRetrievedIncremental(const Item::List &changed, const Item::List &removed) | ||||
42 | { | ||||
43 | m_resource->itemsRetrievedIncremental(changed, removed); | ||||
44 | } | ||||
45 | | ||||
46 | void GoogleResourceState::itemsRetrievalDone() | ||||
47 | { | ||||
48 | m_resource->itemsRetrievalDone(); | ||||
49 | } | ||||
50 | | ||||
51 | void GoogleResourceState::setTotalItems(int amount) | ||||
52 | { | ||||
53 | m_resource->setTotalItems(amount); | ||||
54 | | ||||
55 | } | ||||
56 | void GoogleResourceState::itemChangeCommitted(const Item &item) | ||||
57 | { | ||||
58 | m_resource->changeCommitted(item); | ||||
59 | } | ||||
60 | | ||||
61 | void GoogleResourceState::itemsChangesCommitted(const Item::List &items) | ||||
62 | { | ||||
63 | m_resource->changesCommitted(items); | ||||
64 | } | ||||
65 | | ||||
66 | Item::List GoogleResourceState::currentItems() | ||||
67 | { | ||||
68 | return m_resource->currentItems(); | ||||
69 | } | ||||
70 | | ||||
71 | // Collections handling | ||||
72 | void GoogleResourceState::collectionsRetrieved(const Collection::List &collections) | ||||
73 | { | ||||
74 | m_resource->collectionsRetrieved(collections); | ||||
75 | } | ||||
76 | | ||||
77 | void GoogleResourceState::collectionAttributesRetrieved(const Collection &collection) | ||||
78 | { | ||||
79 | m_resource->collectionAttributesRetrieved(collection); | ||||
80 | } | ||||
81 | | ||||
82 | void GoogleResourceState::collectionChangeCommitted(const Collection &collection) | ||||
83 | { | ||||
84 | m_resource->changeCommitted(collection); | ||||
85 | } | ||||
86 | | ||||
87 | void GoogleResourceState::collectionsRetrievedFromHandler(const Collection::List &collections) | ||||
88 | { | ||||
89 | m_resource->collectionsRetrievedFromHandler(collections); | ||||
90 | } | ||||
91 | | ||||
92 | Collection GoogleResourceState::currentCollection() | ||||
93 | { | ||||
94 | return m_resource->currentCollection(); | ||||
95 | } | ||||
96 | | ||||
97 | // Tags handling | ||||
98 | void GoogleResourceState::tagsRetrieved(const Tag::List &tags, const QHash<QString, Item::List> &tagMembers) | ||||
99 | { | ||||
100 | m_resource->tagsRetrieved(tags, tagMembers); | ||||
101 | } | ||||
102 | | ||||
103 | void GoogleResourceState::tagChangeCommitted(const Tag &tag) | ||||
104 | { | ||||
105 | m_resource->changeCommitted(tag); | ||||
106 | } | ||||
107 | | ||||
108 | | ||||
109 | // Relations handling | ||||
110 | void GoogleResourceState::relationsRetrieved(const Relation::List &relations) | ||||
111 | { | ||||
112 | m_resource->relationsRetrieved(relations); | ||||
113 | } | ||||
114 | | ||||
115 | | ||||
116 | // FreeBusy handling | ||||
117 | void GoogleResourceState::freeBusyRetrieved(const QString &email, const QString &freeBusy, bool success, const QString &errorText = QString()) | ||||
118 | { | ||||
119 | m_resource->freeBusyRetrieved(email, freeBusy, success, errorText); | ||||
120 | } | ||||
121 | | ||||
122 | void GoogleResourceState::handlesFreeBusy(const QString &email, bool handles) | ||||
123 | { | ||||
124 | m_resource->handlesFreeBusy(email, handles); | ||||
125 | } | ||||
126 | | ||||
127 | | ||||
128 | // Result reporting | ||||
129 | void GoogleResourceState::changeProcessed() | ||||
130 | { | ||||
131 | m_resource->changeProcessed(); | ||||
132 | } | ||||
133 | | ||||
134 | void GoogleResourceState::cancelTask(const QString &errorString) | ||||
135 | { | ||||
136 | m_resource->cancelTask(errorString); | ||||
137 | } | ||||
138 | | ||||
139 | void GoogleResourceState::deferTask() | ||||
140 | { | ||||
141 | m_resource->deferTask(); | ||||
142 | } | ||||
143 | | ||||
144 | void GoogleResourceState::taskDone() | ||||
145 | { | ||||
146 | m_resource->taskDone(); | ||||
147 | } | ||||
148 | | ||||
149 | void GoogleResourceState::emitStatus(int status, const QString &message) | ||||
150 | { | ||||
151 | Q_EMIT m_resource->status(status, message); | ||||
152 | } | ||||
153 | | ||||
154 | void GoogleResourceState::emitError(const QString &message) | ||||
155 | { | ||||
156 | Q_EMIT m_resource->error(message); | ||||
157 | } | ||||
158 | | ||||
159 | void GoogleResourceState::emitWarning(const QString &message) | ||||
160 | { | ||||
161 | Q_EMIT m_resource->warning(message); | ||||
162 | } | ||||
163 | | ||||
164 | void GoogleResourceState::emitPercent(int percent) | ||||
165 | { | ||||
166 | Q_EMIT m_resource->percent(percent); | ||||
167 | } | ||||
168 | | ||||
169 | bool GoogleResourceState::canPerformTask() | ||||
170 | { | ||||
171 | return m_resource->canPerformTask(); | ||||
172 | } | ||||
173 | | ||||
174 | bool GoogleResourceState::handleError(KGAPI2::Job *job, bool _cancelTask) | ||||
175 | { | ||||
176 | return m_resource->handleError(job, _cancelTask); | ||||
177 | } | ||||
178 | | ||||
179 | void GoogleResourceState::scheduleCustomTask(QObject *receiver, const char *method, const QVariant &argument) | ||||
180 | { | ||||
181 | return m_resource->scheduleCustomTask(receiver, method, argument); | ||||
182 | } |