File indexing completed on 2024-11-24 04:43:57
0001 /* 0002 SPDX-FileCopyrightText: 2020 Igor Poboiko <igor.poboiko@gmail.com> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "googleresourcestate.h" 0008 #include "googleresource.h" 0009 0010 using namespace Akonadi; 0011 0012 GoogleResourceState::GoogleResourceState(GoogleResource *resource) 0013 : m_resource(resource) 0014 { 0015 } 0016 0017 // Items handling 0018 void GoogleResourceState::itemRetrieved(const Item &item) 0019 { 0020 m_resource->itemRetrieved(item); 0021 } 0022 0023 void GoogleResourceState::itemsRetrieved(const Item::List &items) 0024 { 0025 m_resource->itemsRetrieved(items); 0026 } 0027 0028 void GoogleResourceState::itemsRetrievedIncremental(const Item::List &changed, const Item::List &removed) 0029 { 0030 m_resource->itemsRetrievedIncremental(changed, removed); 0031 } 0032 0033 void GoogleResourceState::itemsRetrievalDone() 0034 { 0035 m_resource->itemsRetrievalDone(); 0036 } 0037 0038 void GoogleResourceState::setTotalItems(int amount) 0039 { 0040 m_resource->setTotalItems(amount); 0041 } 0042 0043 void GoogleResourceState::itemChangeCommitted(const Item &item) 0044 { 0045 m_resource->changeCommitted(item); 0046 } 0047 0048 void GoogleResourceState::itemsChangesCommitted(const Item::List &items) 0049 { 0050 m_resource->changesCommitted(items); 0051 } 0052 0053 Item::List GoogleResourceState::currentItems() 0054 { 0055 return m_resource->currentItems(); 0056 } 0057 0058 // Collections handling 0059 void GoogleResourceState::collectionsRetrieved(const Collection::List &collections) 0060 { 0061 m_resource->collectionsRetrieved(collections); 0062 } 0063 0064 void GoogleResourceState::collectionAttributesRetrieved(const Collection &collection) 0065 { 0066 m_resource->collectionAttributesRetrieved(collection); 0067 } 0068 0069 void GoogleResourceState::collectionChangeCommitted(const Collection &collection) 0070 { 0071 m_resource->changeCommitted(collection); 0072 } 0073 0074 void GoogleResourceState::collectionsRetrievedFromHandler(const Collection::List &collections) 0075 { 0076 m_resource->collectionsRetrievedFromHandler(collections); 0077 } 0078 0079 Collection GoogleResourceState::currentCollection() 0080 { 0081 return m_resource->currentCollection(); 0082 } 0083 0084 // Tags handling 0085 void GoogleResourceState::tagsRetrieved(const Tag::List &tags, const QHash<QString, Item::List> &tagMembers) 0086 { 0087 m_resource->tagsRetrieved(tags, tagMembers); 0088 } 0089 0090 void GoogleResourceState::tagChangeCommitted(const Tag &tag) 0091 { 0092 m_resource->changeCommitted(tag); 0093 } 0094 0095 // Relations handling 0096 void GoogleResourceState::relationsRetrieved(const Relation::List &relations) 0097 { 0098 m_resource->relationsRetrieved(relations); 0099 } 0100 0101 // FreeBusy handling 0102 void GoogleResourceState::freeBusyRetrieved(const QString &email, const QString &freeBusy, bool success, const QString &errorText = QString()) 0103 { 0104 m_resource->freeBusyRetrieved(email, freeBusy, success, errorText); 0105 } 0106 0107 void GoogleResourceState::handlesFreeBusy(const QString &email, bool handles) 0108 { 0109 m_resource->handlesFreeBusy(email, handles); 0110 } 0111 0112 // Result reporting 0113 void GoogleResourceState::changeProcessed() 0114 { 0115 m_resource->changeProcessed(); 0116 } 0117 0118 void GoogleResourceState::cancelTask(const QString &errorString) 0119 { 0120 m_resource->cancelTask(errorString); 0121 } 0122 0123 void GoogleResourceState::deferTask() 0124 { 0125 m_resource->deferTask(); 0126 } 0127 0128 void GoogleResourceState::taskDone() 0129 { 0130 m_resource->taskDone(); 0131 } 0132 0133 void GoogleResourceState::emitStatus(int status, const QString &message) 0134 { 0135 Q_EMIT m_resource->status(status, message); 0136 } 0137 0138 void GoogleResourceState::emitError(const QString &message) 0139 { 0140 Q_EMIT m_resource->error(message); 0141 } 0142 0143 void GoogleResourceState::emitWarning(const QString &message) 0144 { 0145 Q_EMIT m_resource->warning(message); 0146 } 0147 0148 void GoogleResourceState::emitPercent(int percent) 0149 { 0150 Q_EMIT m_resource->percent(percent); 0151 } 0152 0153 bool GoogleResourceState::canPerformTask() 0154 { 0155 return m_resource->canPerformTask(); 0156 } 0157 0158 bool GoogleResourceState::handleError(KGAPI2::Job *job, bool _cancelTask) 0159 { 0160 return m_resource->handleError(job, _cancelTask); 0161 } 0162 0163 void GoogleResourceState::scheduleCustomTask(QObject *receiver, const char *method, const QVariant &argument) 0164 { 0165 m_resource->scheduleCustomTask(receiver, method, argument); 0166 }