root/todo/tags/0.1.20/src/Todo.h

Revision 340, 1.1 kB (checked in by athomas, 2 years ago)

Dev Todo:

  • Fixes #25
  • Fix for compilation under G++ 4.1
Line 
1 #ifndef TODO_H__
2 #define TODO_H__
3
4 #include <stdexcept>
5 #include <string>
6 #include <set>
7 #include <sys/types.h>
8
9 using namespace std;
10
11 /*
12         Todo is the basic data structure for each entry in the .todo database.
13
14         01/02/01        Initial creation
15 */
16
17 class TodoDB;
18
19 class Todo {
20         public :
21                 friend class TodoDB;
22
23                 class exception : public runtime_error { public : exception(char const *what) : runtime_error(what) {} };
24
25                 enum Type {
26                         Note = 0,
27                         Link
28                 };
29
30                 enum Priority {
31                         Default = -2,
32                         None = -1,
33                         VeryLow = 0,
34                         Low,
35                         Medium,
36                         High,
37                         VeryHigh,
38                 };
39
40                 Todo();
41                 Todo(const Todo &other);
42                 ~Todo();
43
44                 int operator < (Todo const &other) const;
45                 int operator == (Todo const &other) const;
46
47                 Todo &operator = (const Todo &other);
48
49                 void incUnFilteredChildren();
50                 void decUnFilteredChildren();
51
52                 // this is saved
53                 Priority priority;
54                 string text, todofile, comment;
55                 bool done;
56                 time_t added, doneTime;
57
58                 // not saved to xml
59                 int index, unfilteredchildren;
60                 bool filtered;
61                 Type type;
62
63                 multiset<Todo> *child, *in;
64                 Todo *parent;
65                
66                 TodoDB *db;
67 };
68
69 #endif
Note: See TracBrowser for help on using the browser.