File indexing completed on 2025-01-05 04:59:40

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_PROJECTREPOSITORY_H
0008 #define AKONADI_PROJECTREPOSITORY_H
0009 
0010 #include "domain/projectrepository.h"
0011 
0012 #include "akonadi/akonadiserializerinterface.h"
0013 #include "akonadi/akonadistorageinterface.h"
0014 
0015 namespace Akonadi {
0016 
0017 class ProjectRepository : public QObject, public Domain::ProjectRepository
0018 {
0019     Q_OBJECT
0020 public:
0021     typedef QSharedPointer<ProjectRepository> Ptr;
0022 
0023     ProjectRepository(const StorageInterface::Ptr &storage,
0024                       const SerializerInterface::Ptr &serializer);
0025 
0026     KJob *create(Domain::Project::Ptr project, Domain::DataSource::Ptr source) override;
0027     KJob *update(Domain::Project::Ptr project) override;
0028     KJob *remove(Domain::Project::Ptr project) override;
0029 
0030     KJob *associate(Domain::Project::Ptr parent, Domain::Task::Ptr child) override;
0031     KJob *dissociate(Domain::Task::Ptr child) override;
0032 
0033 private:
0034     StorageInterface::Ptr m_storage;
0035     SerializerInterface::Ptr m_serializer;
0036 };
0037 
0038 }
0039 
0040 #endif // AKONADI_PROJECTREPOSITORY_H