-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTask.h
More file actions
41 lines (32 loc) · 739 Bytes
/
Copy pathTask.h
File metadata and controls
41 lines (32 loc) · 739 Bytes
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
#ifndef TASK_H
#define TASK_H
#include <QObject>
#include <QString>
class Task : public QObject
{
Q_OBJECT
public:
Task(QObject *parent = 0);
~Task();
void setName(const QString name);
void setId(int id);
void setTime(int time);
void setActive(bool active);
void toggle();
QString getName() const;
int getId() const;
int getTotalTime() const;
int getCurrentDuration() const;
bool isActive() const;
QString toText() const;
void tick();
signals:
void toggled(bool newState);
private:
QString name;
int id; // IDs are needed because names can be changed. An ID of -1 means unassigned
int time;
int timeOfToggle;
bool active;
};
#endif // TASK_H