Diffstat (limited to 'noncore/unsupported/libopie/pim/otodoaccess.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/libopie/pim/otodoaccess.h | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/noncore/unsupported/libopie/pim/otodoaccess.h b/noncore/unsupported/libopie/pim/otodoaccess.h new file mode 100644 index 0000000..916923f --- a/dev/null +++ b/noncore/unsupported/libopie/pim/otodoaccess.h | |||
@@ -0,0 +1,105 @@ | |||
1 | #ifndef OPIE_TODO_ACCESS_H | ||
2 | #define OPIE_TODO_ACCESS_H | ||
3 | |||
4 | #include <qobject.h> | ||
5 | #include <qvaluelist.h> | ||
6 | |||
7 | #include "otodo.h" | ||
8 | #include "otodoaccessbackend.h" | ||
9 | #include "opimaccesstemplate.h" | ||
10 | |||
11 | |||
12 | /** | ||
13 | * OTodoAccess | ||
14 | * the class to get access to | ||
15 | * the todolist | ||
16 | */ | ||
17 | class OTodoAccess : public QObject, public OPimAccessTemplate<OTodo> { | ||
18 | Q_OBJECT | ||
19 | public: | ||
20 | enum SortOrder { Completed = 0, | ||
21 | Priority, | ||
22 | Description, | ||
23 | Deadline }; | ||
24 | enum SortFilter{ Category =1, | ||
25 | OnlyOverDue= 2, | ||
26 | DoNotShowCompleted =4 }; | ||
27 | /** | ||
28 | * if you use 0l | ||
29 | * the default resource will be | ||
30 | * picked up | ||
31 | */ | ||
32 | OTodoAccess( OTodoAccessBackend* = 0l, enum Access acc = Random ); | ||
33 | ~OTodoAccess(); | ||
34 | |||
35 | |||
36 | /* our functions here */ | ||
37 | /** | ||
38 | * include todos from start to end | ||
39 | * includeNoDates whether or not to include | ||
40 | * events with no dates | ||
41 | */ | ||
42 | List effectiveToDos( const QDate& start, | ||
43 | const QDate& end, | ||
44 | bool includeNoDates = true ); | ||
45 | |||
46 | /** | ||
47 | * start | ||
48 | * end date taken from the currentDate() | ||
49 | */ | ||
50 | List effectiveToDos( const QDate& start, | ||
51 | bool includeNoDates = true ); | ||
52 | |||
53 | |||
54 | /** | ||
55 | * return overdue OTodos | ||
56 | */ | ||
57 | List overDue(); | ||
58 | |||
59 | /** | ||
60 | * | ||
61 | */ | ||
62 | List sorted( bool ascending, int sortOrder, int sortFilter, int cat ); | ||
63 | |||
64 | /** | ||
65 | * merge a list of OTodos into | ||
66 | * the resource | ||
67 | */ | ||
68 | void mergeWith( const QValueList<OTodo>& ); | ||
69 | |||
70 | /** | ||
71 | * delete all already completed items | ||
72 | */ | ||
73 | void removeAllCompleted(); | ||
74 | |||
75 | /** | ||
76 | * request information about what a backend supports. | ||
77 | * Supports in the sense of beeing able to store. | ||
78 | * This is related to the enum in OTodo | ||
79 | * | ||
80 | * @param backend Will be used in the future when we support multiple backend | ||
81 | */ | ||
82 | QBitArray backendSupport( const QString& backend = QString::null )const; | ||
83 | |||
84 | /** | ||
85 | * see above but for a specefic attribute. This method was added for convience | ||
86 | * @param attr The attribute to be queried for | ||
87 | * @param backend Will be used in the future when we support multiple backends | ||
88 | */ | ||
89 | bool backendSupports( int attr, const QString& backend = QString::null )const; | ||
90 | signals: | ||
91 | /** | ||
92 | * if the OTodoAccess was changed | ||
93 | */ | ||
94 | void changed( const OTodoAccess* ); | ||
95 | void changed( const OTodoAccess*, int uid ); | ||
96 | void added( const OTodoAccess*, int uid ); | ||
97 | void removed( const OTodoAccess*, int uid ); | ||
98 | private: | ||
99 | int m_cat; | ||
100 | OTodoAccessBackend* m_todoBackEnd; | ||
101 | class OTodoAccessPrivate; | ||
102 | OTodoAccessPrivate* d; | ||
103 | }; | ||
104 | |||
105 | #endif | ||