]> git.sven.stormbind.net Git - sven/vym.git/blobdiff - src/task.h
New upstream version 2.9.22
[sven/vym.git] / src / task.h
diff --git a/src/task.h b/src/task.h
new file mode 100644 (file)
index 0000000..acad5ae
--- /dev/null
@@ -0,0 +1,74 @@
+#ifndef TASK_H
+#define TASK_H
+
+#include <QDateTime>
+#include <QString>
+
+#include "xmlobj.h"
+
+class BranchItem;
+class QString;
+class TaskModel;
+class VymModel;
+
+class Task : public XMLObj {
+  public:
+    enum Status { NotStarted, WIP, Finished };
+    enum Awake { Sleeping, Morning, WideAwake };
+
+    Task(TaskModel *tm);
+    ~Task();
+    void setModel(TaskModel *tm);
+    void cycleStatus(bool reverse = false);
+    void setStatus(const QString &s);
+    void setStatus(Status ts);
+    Status getStatus();
+    QString getStatusString();
+    QString
+    getIconString(); //! Used to create icons in task list and flags in mapview
+    void setAwake(const QString &s);
+    void setAwake(Awake a);
+    Awake getAwake();
+    QString getAwakeString();
+    bool updateAwake();
+
+  public:
+    void setPriority(int p);
+    int getPriority();
+    int getAgeCreation();
+    int getAgeModification();
+    void setDateCreation(const QString &s);
+    QDateTime getDateCreation();
+    void setDateModification();
+    void setDateModification(const QString &s);
+    QDateTime getDateModification();
+    bool setDaysSleep(qint64 n);
+    bool setHoursSleep(qint64 n);
+    bool setSecsSleep(qint64 n);
+    bool setDateSleep(const QString &s);
+    bool setDateSleep(const QDateTime &d);
+    qint64 getDaysSleep();
+    qint64 getSecsSleep();
+    QDateTime getSleep();
+    QString getName();
+    void setPriorityDelta(const int &n);
+    int getPriorityDelta();
+    void setBranch(BranchItem *bi);
+    BranchItem *getBranch();
+    QString getMapName();
+    QString saveToDir();
+
+  private:
+    TaskModel *model;
+    Status status;
+    Awake awake;
+    int prio;
+    int prio_delta;
+    BranchItem *branch;
+    QString mapName;
+    QDateTime date_creation;
+    QDateTime date_modification;
+    QDateTime date_sleep;
+};
+
+#endif