File indexing completed on 2024-06-02 05:32:56

0001 /*
0002  * SPDX-FileCopyrightText: 2014 Kevin Ottens <ervin@kde.org>
0003  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004  */
0005 
0006 
0007 #ifndef AKONADI_STORAGE_H
0008 #define AKONADI_STORAGE_H
0009 
0010 #include "akonadistorageinterface.h"
0011 
0012 #include <Akonadi/CollectionFetchJob>
0013 
0014 class ItemJob;
0015 namespace Akonadi {
0016 
0017 class Storage : public StorageInterface
0018 {
0019 public:
0020     Storage();
0021     virtual ~Storage();
0022 
0023     Akonadi::Collection defaultCollection() override;
0024 
0025     KJob *createItem(Item item, Collection collection) override;
0026     KJob *updateItem(Item item, QObject *parent) override;
0027     KJob *removeItem(Akonadi::Item item, QObject *parent) override;
0028     KJob *removeItems(Item::List items, QObject *parent) override;
0029     KJob *moveItem(Item item, Collection collection, QObject *parent) override;
0030     KJob *moveItems(Item::List item, Collection collection, QObject *parent) override;
0031 
0032     KJob *createCollection(Collection collection, QObject *parent) override;
0033     KJob *updateCollection(Collection collection, QObject *parent) override;
0034     KJob *removeCollection(Collection collection, QObject *parent) override;
0035 
0036     KJob *createTransaction(QObject *parent) override;
0037 
0038     CollectionFetchJobInterface *fetchCollections(Akonadi::Collection collection, FetchDepth depth, QObject *parent) override;
0039     ItemFetchJobInterface *fetchItems(Akonadi::Collection collection, QObject *parent) override;
0040     ItemFetchJobInterface *fetchItem(Akonadi::Item item, QObject *parent) override;
0041 
0042     ItemFetchJobInterface *fetchItemsWithTags(Akonadi::Collection collection);
0043 
0044 private:
0045     CollectionFetchJob::Type jobTypeFromDepth(StorageInterface::FetchDepth depth);
0046     void configureItemFetchJob(ItemJob *job);
0047 };
0048 
0049 }
0050 
0051 #endif // AKONADI_STORAGE_H