File indexing completed on 2024-11-24 04:44:35
0001 /* This file is part of the KDE project 0002 SPDX-FileCopyrightText: 2009, 2010 Kevin Krammer <kevin.krammer@gmx.at> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "akonadi-filestore_export.h" 0010 0011 #include <QList> 0012 0013 // TODO not nice, collection fetch type should probably be in its own header 0014 #include "collectionfetchjob.h" 0015 0016 namespace Akonadi 0017 { 0018 class Collection; 0019 class Item; 0020 0021 namespace FileStore 0022 { 0023 class CollectionCreateJob; 0024 class CollectionDeleteJob; 0025 class CollectionFetchJob; 0026 class CollectionModifyJob; 0027 class CollectionMoveJob; 0028 class ItemCreateJob; 0029 class ItemDeleteJob; 0030 class ItemFetchJob; 0031 class ItemModifyJob; 0032 class ItemMoveJob; 0033 class StoreCompactJob; 0034 0035 /** 0036 */ 0037 class AKONADI_FILESTORE_EXPORT StoreInterface 0038 { 0039 public: 0040 virtual ~StoreInterface() = default; 0041 0042 virtual Collection topLevelCollection() const = 0; 0043 0044 virtual CollectionCreateJob *createCollection(const Collection &collection, const Collection &targetParent) = 0; 0045 0046 virtual CollectionFetchJob *fetchCollections(const Collection &collection, CollectionFetchJob::Type type = CollectionFetchJob::FirstLevel) const = 0; 0047 0048 virtual CollectionDeleteJob *deleteCollection(const Collection &collection) = 0; 0049 0050 virtual CollectionModifyJob *modifyCollection(const Collection &collection) = 0; 0051 0052 virtual CollectionMoveJob *moveCollection(const Collection &collection, const Collection &targetParent) = 0; 0053 0054 virtual ItemFetchJob *fetchItems(const Collection &collection) const = 0; 0055 0056 virtual ItemFetchJob *fetchItems(const QList<Item> &items) const = 0; 0057 0058 virtual ItemFetchJob *fetchItem(const Item &item) const = 0; 0059 0060 virtual ItemCreateJob *createItem(const Item &item, const Collection &collection) = 0; 0061 0062 virtual ItemModifyJob *modifyItem(const Item &item) = 0; 0063 0064 virtual ItemDeleteJob *deleteItem(const Item &item) = 0; 0065 0066 virtual ItemMoveJob *moveItem(const Item &item, const Collection &targetParent) = 0; 0067 0068 virtual StoreCompactJob *compactStore() = 0; 0069 0070 protected: 0071 virtual void setTopLevelCollection(const Collection &collection) = 0; 0072 }; 0073 } 0074 }