This repository has been archived by the owner on Jul 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontroller.h
81 lines (61 loc) · 1.72 KB
/
controller.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include <time.h>
#include <QDate>
#include <QObject>
#include <QString>
#include <QTimer>
#include <vector>
#include "./model/model.h"
#include "mainwindow.h"
#include "myvector.h"
class Controller : public QObject {
Q_OBJECT
private:
enum SendTo {
Edit_List = 0,
Edit = 1,
List = 2
};
MainWindow *view;
// std::vector<Item *> items;
MyVector<Item *> items;
int selectedIndex;
QTimer *timer;
void
itemSender(Item *, int, SendTo);
void sendItemSelected();
void sendItems();
QDate convertDate(Date);
QString convertType(Item::Type);
Item::Type convertType(QString);
void saveXML();
void openXML();
public:
explicit Controller(MainWindow *, QObject *parent = nullptr);
signals:
void sendItemType(Item::Type);
void sendTitleInformation(QString);
void sendDescriptionInformation(QString);
void sendDateInformation(QDate);
void sendToDoInformation(int, QString, bool);
void sendMemoInformation(int, QString, QString);
void sendReminderInformation(int, QString, QDate);
void sendMemoToDoInformation(int, QString, QString, bool);
void sendToDoReminderInformation(int, QString, QDate, bool);
void sendReminderDialog(QString, QDate);
void sendDeselect();
void deleteItem(int);
public slots:
void checkReminder();
void onReceiveItemIndexSelected(int);
void onReceiveItemIndexChechBoxToggled(int);
void onAddNewItemButtonClicked();
void onDeleteItemButtonClicked();
void onReceivedSavedToDo(QString);
void onReceivedSavedMemo(QString, QString);
void onReceivedSavedReminder(QString, QDate);
void onReceivedSavedMemoToDo(QString, QString);
void onReceivedSavedToDoReminder(QString, QDate);
};
#endif // CONTROLLER_H