Changeset View
Changeset View
Standalone View
Standalone View
resources/google-groupware/googleresourcestateinterface.h
- 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 | #ifndef GOOGLERESOURCESTATEINTERFACE_H | ||||
21 | #define GOOGLERESOURCESTATEINTERFACE_H | ||||
22 | | ||||
23 | #include "resourcestateinterface.h" | ||||
24 | | ||||
25 | namespace KGAPI2 | ||||
26 | { | ||||
27 | class Job; | ||||
28 | } | ||||
29 | | ||||
30 | /** | ||||
31 | * This is a ResourceStateInterface with some specific for Google Resource bits | ||||
32 | */ | ||||
33 | class GoogleResourceStateInterface : public ResourceStateInterface | ||||
34 | { | ||||
35 | public: | ||||
36 | /** | ||||
37 | * Returns whether the resource is operational (i.e. account is configured) | ||||
38 | */ | ||||
39 | virtual bool canPerformTask() = 0; | ||||
40 | | ||||
41 | /** | ||||
42 | * Handles an error (if any) for a job. It includes cancelling a task | ||||
43 | * (if there was an error), or retrying to authenticate (if necessary) | ||||
44 | */ | ||||
45 | virtual bool handleError(KGAPI2::Job *job, bool _cancelTask = true) = 0; | ||||
46 | | ||||
47 | /** | ||||
48 | * Each handler use this to report that it has finished collection fetching | ||||
49 | */ | ||||
50 | virtual void collectionsRetrievedFromHandler(const Akonadi::Collection::List &collections) = 0; | ||||
51 | | ||||
52 | /** | ||||
53 | * FreeBusy | ||||
54 | */ | ||||
55 | virtual void freeBusyRetrieved(const QString &email, const QString &freeBusy, bool success, const QString &errorText = QString()) = 0; | ||||
56 | virtual void handlesFreeBusy(const QString &email, bool handles) = 0; | ||||
57 | | ||||
58 | virtual void scheduleCustomTask(QObject *receiver, const char *method, const QVariant &argument) = 0; | ||||
59 | }; | ||||
60 | | ||||
61 | #endif // GOOGLERESOURCESTATEINTERFACE_H |