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
@@ -65,7 +65,13 @@ void OTodoAccess::delAlarm( int uid) {
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
@@ -14,16 +14,23 @@
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 */
@@ -45,12 +52,18 @@ public:
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
@@ -68,12 +81,13 @@ public:
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