File indexing completed on 2025-01-19 04:56:35
0001 /* 0002 * SPDX-FileCopyrightText: 2014 Kevin Ottens <ervin@kde.org> 0003 SPDX-FileCopyrightText: 2014 Franck Arrecot<franck.arrecot@kgmail.com> 0004 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0005 */ 0006 0007 0008 #ifndef AKONADICONTEXTREPOSITORY_H 0009 #define AKONADICONTEXTREPOSITORY_H 0010 0011 #include "domain/contextrepository.h" 0012 0013 #include "akonadi/akonadiserializerinterface.h" 0014 #include "akonadi/akonadistorageinterface.h" 0015 0016 namespace Akonadi { 0017 0018 class ContextRepository : public QObject, public Domain::ContextRepository 0019 { 0020 Q_OBJECT 0021 public: 0022 typedef QSharedPointer<ContextRepository> Ptr; 0023 0024 ContextRepository(const StorageInterface::Ptr &storage, 0025 const SerializerInterface::Ptr &serializer); 0026 0027 KJob *create(Domain::Context::Ptr context, Domain::DataSource::Ptr source) override; 0028 KJob *update(Domain::Context::Ptr context) override; 0029 KJob *remove(Domain::Context::Ptr context) override; 0030 0031 KJob *associate(Domain::Context::Ptr context, Domain::Task::Ptr child) override; 0032 KJob *dissociate(Domain::Context::Ptr context, Domain::Task::Ptr child) override; 0033 KJob *dissociateAll(Domain::Task::Ptr child) override; 0034 0035 private: 0036 StorageInterface::Ptr m_storage; 0037 SerializerInterface::Ptr m_serializer; 0038 }; 0039 0040 } 0041 0042 #endif // AKONADICONTEXTREPOSITORY_H