File indexing completed on 2024-11-17 04:45:01
0001 /* 0002 SPDX-FileCopyrightText: 2020 Igor Poboiko <igor.poboiko@gmail.com> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "resourcestateinterface.h" 0010 0011 namespace KGAPI2 0012 { 0013 class Job; 0014 } 0015 0016 /** 0017 * This is a ResourceStateInterface with some specific for Google Resource bits 0018 */ 0019 class GoogleResourceStateInterface : public ResourceStateInterface 0020 { 0021 public: 0022 /** 0023 * Returns whether the resource is operational (i.e. account is configured) 0024 */ 0025 virtual bool canPerformTask() = 0; 0026 0027 /** 0028 * Handles an error (if any) for a job. It includes cancelling a task 0029 * (if there was an error), or retrying to authenticate (if necessary) 0030 */ 0031 virtual bool handleError(KGAPI2::Job *job, bool _cancelTask = true) = 0; 0032 0033 /** 0034 * Each handler use this to report that it has finished collection fetching 0035 */ 0036 virtual void collectionsRetrievedFromHandler(const Akonadi::Collection::List &collections) = 0; 0037 0038 /** 0039 * FreeBusy 0040 */ 0041 virtual void freeBusyRetrieved(const QString &email, const QString &freeBusy, bool success, const QString &errorText = QString()) = 0; 0042 virtual void handlesFreeBusy(const QString &email, bool handles) = 0; 0043 0044 virtual void scheduleCustomTask(QObject *receiver, const char *method, const QVariant &argument) = 0; 0045 };