00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include <qdatetime.h>
00030
00031 #include <qpe/alarmserver.h>
00032
00033
00034 #include <opie2/otodoaccess.h>
00035 #include <opie2/obackendfactory.h>
00036 #include <opie2/opimresolver.h>
00037 #include <opie2/opimglobal.h>
00038
00039 namespace Opie {
00040 OPimTodoAccess::OPimTodoAccess( OPimTodoAccessBackend* end, enum Access )
00041 : QObject(), OPimAccessTemplate<OPimTodo>( end ), m_todoBackEnd( end )
00042 {
00043
00044
00045
00046
00047 if (end == 0l )
00048 m_todoBackEnd = OBackendFactory<OPimTodoAccessBackend>::defaultBackend (OPimGlobal::TODOLIST, QString::null);
00049
00050 setBackEnd( m_todoBackEnd );
00051 }
00052 OPimTodoAccess::~OPimTodoAccess() {
00053 }
00054
00055 void OPimTodoAccess::mergeWith( const QValueList<OPimTodo>& list ) {
00056 QValueList<OPimTodo>::ConstIterator it;
00057 for ( it = list.begin(); it != list.end(); ++it ) {
00058 replace( (*it) );
00059 }
00060 }
00061 OPimTodoAccess::List OPimTodoAccess::effectiveToDos( const QDate& start,
00062 const QDate& end,
00063 bool includeNoDates )const {
00064 QArray<int> ints = m_todoBackEnd->effectiveToDos( start, end, includeNoDates );
00065
00066 List lis( ints, this );
00067 return lis;
00068 }
00069 OPimTodoAccess::List OPimTodoAccess::effectiveToDos( const QDate& start,
00070 bool includeNoDates )const {
00071 return effectiveToDos( start, QDate::currentDate(),
00072 includeNoDates );
00073 }
00074 OPimTodoAccess::List OPimTodoAccess::overDue()const {
00075 List lis( m_todoBackEnd->overDue(), this );
00076 return lis;
00077 }
00078
00079 void OPimTodoAccess::removeAllCompleted() {
00080 m_todoBackEnd->removeAllCompleted();
00081 }
00082
00083 int OPimTodoAccess::rtti() const
00084 {
00085 return OPimResolver::TodoList;
00086 }
00087
00088 }