File indexing completed on 2024-11-24 04:53:43

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 DOMAIN_CONTEXTREPOSITORY_H
0008 #define DOMAIN_CONTEXTREPOSITORY_H
0009 
0010 #include "context.h"
0011 #include "datasource.h"
0012 #include "task.h"
0013 
0014 class KJob;
0015 
0016 namespace Domain {
0017 
0018 class ContextRepository
0019 {
0020 public:
0021     typedef QSharedPointer<ContextRepository> Ptr;
0022 
0023     ContextRepository();
0024     virtual ~ContextRepository();
0025 
0026     virtual KJob *create(Context::Ptr context, DataSource::Ptr source) = 0;
0027     virtual KJob *update(Context::Ptr context) = 0;
0028     virtual KJob *remove(Context::Ptr context) = 0;
0029 
0030     virtual KJob *associate(Context::Ptr parent, Task::Ptr child) = 0;
0031     virtual KJob *dissociate(Context::Ptr parent, Task::Ptr child) = 0;
0032     virtual KJob *dissociateAll(Task::Ptr child) = 0;
0033 };
0034 
0035 }
0036 
0037 #endif // DOMAIN_CONTEXTREPOSITORY_H