summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core
authorzecke <zecke>2002-09-25 11:59:24 (UTC)
committer zecke <zecke>2002-09-25 11:59:24 (UTC)
commit38240090027bd68d8dd15d7d46ecf17792edb732 (patch) (unidiff)
tree589ef486d7169c57592ed8667f6c84d43f882d48 /libopie2/opiepim/core
parent5f2dd0a2340914b4983ebce3813187034e2cb9dc (diff)
downloadopie-38240090027bd68d8dd15d7d46ecf17792edb732.zip
opie-38240090027bd68d8dd15d7d46ecf17792edb732.tar.gz
opie-38240090027bd68d8dd15d7d46ecf17792edb732.tar.bz2
Add a sort function and filter function to TodoAccess
This would allow us todo a paint hack in QTable
Diffstat (limited to 'libopie2/opiepim/core') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/otodoaccess.cpp8
-rw-r--r--libopie2/opiepim/core/otodoaccess.h16
2 files changed, 22 insertions, 2 deletions
diff --git a/libopie2/opiepim/core/otodoaccess.cpp b/libopie2/opiepim/core/otodoaccess.cpp
index 8ec09bc..f51da29 100644
--- a/libopie2/opiepim/core/otodoaccess.cpp
+++ b/libopie2/opiepim/core/otodoaccess.cpp
@@ -59,13 +59,19 @@ void OTodoAccess::delAlarm( int uid) {
59 QDateTime schedule; // Create null DateTime 59 QDateTime schedule; // Create null DateTime
60 60
61 // I hope this will remove all scheduled alarms 61 // I hope this will remove all scheduled alarms
62 // with the given uid !? 62 // with the given uid !?
63 // If not: I have to rethink how to remove already 63 // If not: I have to rethink how to remove already
64 // scheduled events... (se) 64 // scheduled events... (se)
65 // it should be fine -zecke 65 // it should be fine -zecke
66// qWarning("Removing alarm for event with uid %d", uid ); 66// qWarning("Removing alarm for event with uid %d", uid );
67 AlarmServer::deleteAlarm( schedule , 67 AlarmServer::deleteAlarm( schedule ,
68 "QPE/Application/todolist", 68 "QPE/Application/todolist",
69 "alarm(QDateTime,int)", uid ); 69 "alarm(QDateTime,int)", uid );
70} 70}
71 71/* sort order */
72OTodoAccess::List OTodoAccess::sorted( bool ascending, int sort,int filter, int cat ) {
73 QArray<int> ints = m_todoBackEnd->sorted( ascending, sort,
74 filter, cat );
75 OTodoAccess::List list( ints, this );
76 return list;
77}
diff --git a/libopie2/opiepim/core/otodoaccess.h b/libopie2/opiepim/core/otodoaccess.h
index c43efe9..12997aa 100644
--- a/libopie2/opiepim/core/otodoaccess.h
+++ b/libopie2/opiepim/core/otodoaccess.h
@@ -8,28 +8,35 @@
8#include "otodoaccessbackend.h" 8#include "otodoaccessbackend.h"
9#include "opimaccesstemplate.h" 9#include "opimaccesstemplate.h"
10 10
11 11
12/** 12/**
13 * OTodoAccess 13 * OTodoAccess
14 * the class to get access to 14 * the class to get access to
15 * the todolist 15 * the todolist
16 */ 16 */
17class OTodoAccess : public QObject, public OPimAccessTemplate<OTodo> { 17class OTodoAccess : public QObject, public OPimAccessTemplate<OTodo> {
18 Q_OBJECT 18 Q_OBJECT
19public: 19public:
20 enum SortOrder { Completed = 0,
21 Priority,
22 Description,
23 Deadline };
24 enum SortFilter{ ShowOverdue = 0,
25 Category =1,
26 OnlyOverDue= 2 };
20 /** 27 /**
21 * if you use 0l 28 * if you use 0l
22 * the default resource will be 29 * the default resource will be
23 * icked up 30 * picked up
24 */ 31 */
25 OTodoAccess( OTodoAccessBackend* = 0l); 32 OTodoAccess( OTodoAccessBackend* = 0l);
26 ~OTodoAccess(); 33 ~OTodoAccess();
27 34
28 35
29 /* our functions here */ 36 /* our functions here */
30 /** 37 /**
31 * include todos from start to end 38 * include todos from start to end
32 * includeNoDates whether or not to include 39 * includeNoDates whether or not to include
33 * events with no dates 40 * events with no dates
34 */ 41 */
35 List effectiveToDos( const QDate& start, 42 List effectiveToDos( const QDate& start,
@@ -39,41 +46,48 @@ public:
39 /** 46 /**
40 * start 47 * start
41 * end date taken from the currentDate() 48 * end date taken from the currentDate()
42 */ 49 */
43 List effectiveToDos( const QDate& start, 50 List effectiveToDos( const QDate& start,
44 bool includeNoDates = true ); 51 bool includeNoDates = true );
45 52
46 53
47 /** 54 /**
48 * return overdue OTodos 55 * return overdue OTodos
49 */ 56 */
50 List overDue(); 57 List overDue();
58
59 /**
60 *
61 */
62 List sorted( bool ascending, int sortOrder, int sortFilter, int cat );
63
51 /** 64 /**
52 * merge a list of OTodos into 65 * merge a list of OTodos into
53 * the resource 66 * the resource
54 */ 67 */
55 void mergeWith( const QValueList<OTodo>& ); 68 void mergeWith( const QValueList<OTodo>& );
56 69
57 /** 70 /**
58 * add an Alarm to the AlarmServer 71 * add an Alarm to the AlarmServer
59 */ 72 */
60 void addAlarm( const OTodo& ); 73 void addAlarm( const OTodo& );
61 74
62 /** 75 /**
63 * delete an alarm with the uid from 76 * delete an alarm with the uid from
64 * the alarm server 77 * the alarm server
65 */ 78 */
66 void delAlarm( int uid ); 79 void delAlarm( int uid );
67 80
68signals: 81signals:
69 /** 82 /**
70 * if the OTodoAccess was changed 83 * if the OTodoAccess was changed
71 */ 84 */
72 void signalChanged( const OTodoAccess* ); 85 void signalChanged( const OTodoAccess* );
73private: 86private:
87 int m_cat;
74 OTodoAccessBackend* m_todoBackEnd; 88 OTodoAccessBackend* m_todoBackEnd;
75 class OTodoAccessPrivate; 89 class OTodoAccessPrivate;
76 OTodoAccessPrivate* d; 90 OTodoAccessPrivate* d;
77}; 91};
78 92
79#endif 93#endif