File indexing completed on 2025-01-19 04:56:40

0001 /*
0002  * SPDX-FileCopyrightText: 2015 Theo Vaucher <theo.vaucher@gmail.com>
0003  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004  */
0005 
0006 
0007 
0008 #ifndef PRESENTATION_WORKDAYPAGEMODEL_H
0009 #define PRESENTATION_WORKDAYPAGEMODEL_H
0010 
0011 #include "presentation/pagemodel.h"
0012 
0013 #include "domain/taskqueries.h"
0014 #include "domain/taskrepository.h"
0015 
0016 namespace Presentation {
0017 
0018 class WorkdayPageModel : public PageModel
0019 {
0020     Q_OBJECT
0021 public:
0022     explicit WorkdayPageModel(const Domain::TaskQueries::Ptr &taskQueries,
0023                               const Domain::TaskRepository::Ptr &taskRepository,
0024                               QObject *parent = nullptr);
0025 
0026     Domain::Task::Ptr addItem(const QString &title, const QModelIndex &parentIndex = QModelIndex()) override;
0027     void removeItem(const QModelIndex &index) override;
0028     void promoteItem(const QModelIndex &index) override;
0029 
0030 private:
0031     QAbstractItemModel *createCentralListModel() override;
0032 
0033     Domain::TaskQueries::Ptr m_taskQueries;
0034     Domain::TaskRepository::Ptr m_taskRepository;
0035 };
0036 
0037 }
0038 
0039 #endif // PRESENTATION_WORKDAYPAGEMODEL_H