]> git.sven.stormbind.net Git - sven/vym.git/blob - src/task.h
Replace Pierre as the maintainer
[sven/vym.git] / src / task.h
1 #ifndef TASK_H
2 #define TASK_H
3
4 #include <QDateTime>
5 #include <QString>
6
7 #include "xmlobj.h"
8
9 class BranchItem;
10 class QString;
11 class TaskModel;
12 class VymModel;
13
14 class Task : public XMLObj {
15   public:
16     enum Status { NotStarted, WIP, Finished };
17     enum Awake { Sleeping, Morning, WideAwake };
18
19     Task(TaskModel *tm);
20     ~Task();
21     void setModel(TaskModel *tm);
22     void cycleStatus(bool reverse = false);
23     void setStatus(const QString &s);
24     void setStatus(Status ts);
25     Status getStatus();
26     QString getStatusString();
27     QString
28     getIconString(); //! Used to create icons in task list and flags in mapview
29     void setAwake(const QString &s);
30     void setAwake(Awake a);
31     Awake getAwake();
32     QString getAwakeString();
33     bool updateAwake();
34
35   public:
36     void setPriority(int p);
37     int getPriority();
38     int getAgeCreation();
39     int getAgeModification();
40     void setDateCreation(const QString &s);
41     QDateTime getDateCreation();
42     void setDateModification();
43     void setDateModification(const QString &s);
44     QDateTime getDateModification();
45     bool setDaysSleep(qint64 n);
46     bool setHoursSleep(qint64 n);
47     bool setSecsSleep(qint64 n);
48     bool setDateSleep(const QString &s);
49     bool setDateSleep(const QDateTime &d);
50     qint64 getDaysSleep();
51     qint64 getSecsSleep();
52     QDateTime getSleep();
53     QString getName();
54     void setPriorityDelta(const int &n);
55     int getPriorityDelta();
56     void setBranch(BranchItem *bi);
57     BranchItem *getBranch();
58     QString getMapName();
59     QString saveToDir();
60
61   private:
62     TaskModel *model;
63     Status status;
64     Awake awake;
65     int prio;
66     int prio_delta;
67     BranchItem *branch;
68     QString mapName;
69     QDateTime date_creation;
70     QDateTime date_modification;
71     QDateTime date_sleep;
72 };
73
74 #endif