Changeset View
Changeset View
Standalone View
Standalone View
resources/google-groupware/resourcestateinterface.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | Copyright (c) 2020 Igor Poboiko <igor.poboiko@gmail.com> | ||||
3 | Copyright (c) 2010 Klarälvdalens Datakonsult AB, | ||||
4 | a KDAB Group company <info@kdab.com> | ||||
5 | Author: Kevin Ottens <kevin@kdab.com> | ||||
6 | | ||||
7 | This library is free software; you can redistribute it and/or modify it | ||||
8 | under the terms of the GNU Library General Public License as published by | ||||
9 | the Free Software Foundation; either version 2 of the License, or (at your | ||||
10 | option) any later version. | ||||
11 | | ||||
12 | This library is distributed in the hope that it will be useful, but WITHOUT | ||||
13 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||||
14 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public | ||||
15 | License for more details. | ||||
16 | | ||||
17 | You should have received a copy of the GNU Library General Public License | ||||
18 | along with this library; see the file COPYING.LIB. If not, write to the | ||||
19 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||||
20 | 02110-1301, USA. | ||||
21 | */ | ||||
22 | | ||||
23 | #ifndef RESOURCESTATEINTERFACE_H | ||||
24 | #define RESOURCESTATEINTERFACE_H | ||||
25 | | ||||
26 | #include <Collection> | ||||
27 | #include <Item> | ||||
28 | #include <ItemSync> | ||||
29 | | ||||
30 | /** | ||||
31 | * This is a generic interface for ResourceBase class | ||||
32 | */ | ||||
33 | class ResourceStateInterface | ||||
34 | { | ||||
35 | public: | ||||
36 | typedef QSharedPointer<ResourceStateInterface> Ptr; | ||||
37 | | ||||
38 | virtual ~ResourceStateInterface() | ||||
39 | { | ||||
40 | } | ||||
41 | | ||||
42 | // Items handling | ||||
43 | virtual void itemRetrieved(const Akonadi::Item &item) = 0; | ||||
44 | virtual void itemsRetrieved(const Akonadi::Item::List &items) = 0; | ||||
45 | virtual void itemsRetrievedIncremental(const Akonadi::Item::List &changed, const Akonadi::Item::List &removed) = 0; | ||||
46 | virtual void itemsRetrievalDone() = 0; | ||||
47 | virtual void setTotalItems(int) = 0; | ||||
48 | virtual void itemChangeCommitted(const Akonadi::Item &item) = 0; | ||||
49 | virtual void itemsChangesCommitted(const Akonadi::Item::List &items) = 0; | ||||
50 | virtual Akonadi::Item::List currentItems() = 0; | ||||
51 | | ||||
52 | // Collections handling | ||||
53 | virtual void collectionsRetrieved(const Akonadi::Collection::List &collections) = 0; | ||||
54 | virtual void collectionAttributesRetrieved(const Akonadi::Collection &collection) = 0; | ||||
55 | virtual void collectionChangeCommitted(const Akonadi::Collection &collection) = 0; | ||||
56 | virtual Akonadi::Collection currentCollection() = 0; | ||||
57 | | ||||
58 | // Tags handling | ||||
59 | virtual void tagsRetrieved(const Akonadi::Tag::List &tags, const QHash<QString, Akonadi::Item::List> &) = 0; | ||||
60 | virtual void tagChangeCommitted(const Akonadi::Tag &tag) = 0; | ||||
61 | | ||||
62 | // Relations handling | ||||
63 | virtual void relationsRetrieved(const Akonadi::Relation::List &tags) = 0; | ||||
64 | | ||||
65 | // Result reporting | ||||
66 | virtual void changeProcessed() = 0; | ||||
67 | virtual void cancelTask(const QString &errorString) = 0; | ||||
68 | virtual void deferTask() = 0; | ||||
69 | virtual void taskDone() = 0; | ||||
70 | | ||||
71 | virtual void emitStatus(int status, const QString &message) = 0; | ||||
72 | virtual void emitError(const QString &message) = 0; | ||||
73 | virtual void emitWarning(const QString &message) = 0; | ||||
74 | virtual void emitPercent(int percent) = 0; | ||||
75 | }; | ||||
76 | | ||||
77 | #endif // RESOURCESTATEINTERFACE_H |