-
Notifications
You must be signed in to change notification settings - Fork 3
/
backend.h
46 lines (32 loc) · 974 Bytes
/
backend.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef BACKEND_H
#define BACKEND_H
#include <QObject>
#include "taskmodel.h"
#include "taskitem.h"
class Backend : public QObject
{
Q_OBJECT
Q_PROPERTY(QObject* newTaskModel READ newTaskModel NOTIFY newTaskModelChanged)
Q_PROPERTY(QObject* doneTaskModel READ doneTaskModel NOTIFY doneTaskModelChanged)
public:
explicit Backend(QObject *parent = 0);
~Backend();
model::TaskModel* newTaskModel();
model::TaskModel* doneTaskModel();
Q_INVOKABLE void newTask(QString text, QString color);
Q_INVOKABLE void deleteCompletedTask(model::TaskItem* task);
Q_INVOKABLE QString appVersion();
signals:
void newTaskModelChanged();
void doneTaskModelChanged();
private slots:
void scheduleSaveTasks();
void taskStateChanged();
private:
void saveTasks();
void loadTasks();
model::TaskModel m_newTaskModel;
model::TaskModel m_doneTaskModel;
QList<model::TaskItem*> m_taskList;
};
#endif // BACKEND_H