Changeset View
Changeset View
Standalone View
Standalone View
src/akonadi/akonadicachingstorage.h
- This file was added.
1 | /* This file is part of Zanshin | ||||
---|---|---|---|---|---|
2 | | ||||
3 | Copyright 2015 Mario Bensi <mbensi@ipsquad.net> | ||||
4 | Copyright 2017 Kevin Ottens <ervin@kde.org> | ||||
5 | | ||||
6 | This program is free software; you can redistribute it and/or | ||||
7 | modify it under the terms of the GNU General Public License as | ||||
8 | published by the Free Software Foundation; either version 2 of | ||||
9 | the License or (at your option) version 3 or any later version | ||||
10 | accepted by the membership of KDE e.V. (or its successor approved | ||||
11 | by the membership of KDE e.V.), which shall act as a proxy | ||||
12 | defined in Section 14 of version 3 of the license. | ||||
13 | | ||||
14 | This program is distributed in the hope that it will be useful, | ||||
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
17 | GNU General Public License for more details. | ||||
18 | | ||||
19 | You should have received a copy of the GNU General Public License | ||||
20 | along with this program; if not, write to the Free Software | ||||
21 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||||
22 | USA. | ||||
23 | */ | ||||
24 | | ||||
25 | #ifndef AKONADI_CACHING_STORAGE_H | ||||
26 | #define AKONADI_CACHING_STORAGE_H | ||||
27 | | ||||
28 | #include "akonadistorageinterface.h" | ||||
29 | #include "akonadicache.h" | ||||
30 | | ||||
31 | namespace Akonadi { | ||||
32 | | ||||
33 | class CachingStorage : public StorageInterface | ||||
34 | { | ||||
35 | public: | ||||
36 | explicit CachingStorage(const Cache::Ptr &cache, const StorageInterface::Ptr &storage); | ||||
37 | virtual ~CachingStorage(); | ||||
38 | | ||||
39 | Akonadi::Collection defaultTaskCollection() Q_DECL_OVERRIDE; | ||||
40 | Akonadi::Collection defaultNoteCollection() Q_DECL_OVERRIDE; | ||||
41 | | ||||
42 | KJob *createItem(Item item, Collection collection) Q_DECL_OVERRIDE; | ||||
43 | KJob *updateItem(Item item, QObject *parent = Q_NULLPTR) Q_DECL_OVERRIDE; | ||||
44 | KJob *removeItem(Akonadi::Item item) Q_DECL_OVERRIDE; | ||||
45 | KJob *removeItems(Item::List items, QObject *parent = Q_NULLPTR) Q_DECL_OVERRIDE; | ||||
46 | KJob *moveItem(Item item, Collection collection, QObject *parent = Q_NULLPTR) Q_DECL_OVERRIDE; | ||||
47 | KJob *moveItems(Item::List item, Collection collection, QObject *parent = Q_NULLPTR) Q_DECL_OVERRIDE; | ||||
48 | | ||||
49 | KJob *createCollection(Collection collection, QObject *parent = Q_NULLPTR) Q_DECL_OVERRIDE; | ||||
50 | KJob *updateCollection(Collection collection, QObject *parent = Q_NULLPTR) Q_DECL_OVERRIDE; | ||||
51 | KJob *removeCollection(Collection collection, QObject *parent = Q_NULLPTR) Q_DECL_OVERRIDE; | ||||
52 | | ||||
53 | KJob *createTransaction() Q_DECL_OVERRIDE; | ||||
54 | | ||||
55 | KJob *createTag(Akonadi::Tag tag) Q_DECL_OVERRIDE; | ||||
56 | KJob *updateTag(Akonadi::Tag tag) Q_DECL_OVERRIDE; | ||||
57 | KJob *removeTag(Akonadi::Tag tag) Q_DECL_OVERRIDE; | ||||
58 | | ||||
59 | CollectionFetchJobInterface *fetchCollections(Akonadi::Collection collection, FetchDepth depth, FetchContentTypes types) Q_DECL_OVERRIDE; | ||||
60 | ItemFetchJobInterface *fetchItems(Akonadi::Collection collection) Q_DECL_OVERRIDE; | ||||
61 | ItemFetchJobInterface *fetchItem(Akonadi::Item item) Q_DECL_OVERRIDE; | ||||
62 | ItemFetchJobInterface *fetchTagItems(Akonadi::Tag tag) Q_DECL_OVERRIDE; | ||||
63 | TagFetchJobInterface *fetchTags() Q_DECL_OVERRIDE; | ||||
64 | | ||||
65 | private: | ||||
66 | Cache::Ptr m_cache; | ||||
67 | StorageInterface::Ptr m_storage; | ||||
68 | }; | ||||
69 | | ||||
70 | } | ||||
71 | | ||||
72 | #endif // AKONADI_CACHING_STORAGE_H |