-rw-r--r-- | libopie2/opiepim/core/otodoaccess.cpp | 8 | ||||
-rw-r--r-- | libopie2/opiepim/core/otodoaccess.h | 16 |
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 @@ -68,4 +68,10 @@ void OTodoAccess::delAlarm( int uid) { "QPE/Application/todolist", "alarm(QDateTime,int)", uid ); } - +/* sort order */ +OTodoAccess::List OTodoAccess::sorted( bool ascending, int sort,int filter, int cat ) { + QArray<int> ints = m_todoBackEnd->sorted( ascending, sort, + filter, cat ); + OTodoAccess::List list( ints, this ); + return list; +} 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 @@ -17,10 +17,17 @@ class OTodoAccess : public QObject, public OPimAccessTemplate<OTodo> { Q_OBJECT public: + enum SortOrder { Completed = 0, + Priority, + Description, + Deadline }; + enum SortFilter{ ShowOverdue = 0, + Category =1, + OnlyOverDue= 2 }; /** * if you use 0l * the default resource will be - * icked up + * picked up */ OTodoAccess( OTodoAccessBackend* = 0l); ~OTodoAccess(); @@ -48,6 +55,12 @@ public: * return overdue OTodos */ List overDue(); + + /** + * + */ + List sorted( bool ascending, int sortOrder, int sortFilter, int cat ); + /** * merge a list of OTodos into * the resource @@ -71,6 +84,7 @@ signals: */ void signalChanged( const OTodoAccess* ); private: + int m_cat; OTodoAccessBackend* m_todoBackEnd; class OTodoAccessPrivate; OTodoAccessPrivate* d; |