libopie PIM API Documentation

otodoaccess.cpp

Go to the documentation of this file.
00001 #include <qdatetime.h>
00002 
00003 #include <qpe/alarmserver.h>
00004 
00005 // #include "otodoaccesssql.h"
00006 #include "otodoaccess.h"
00007 #include "obackendfactory.h"
00008 
00009 OTodoAccess::OTodoAccess( OTodoAccessBackend* end, enum Access )
00010     : QObject(), OPimAccessTemplate<OTodo>( end ),  m_todoBackEnd( end )
00011 {
00012 //     if (end == 0l )
00013 //         m_todoBackEnd = new OTodoAccessBackendSQL( QString::null);
00014 
00015     // Zecke: Du musst hier noch für das XML-Backend einen Appnamen übergeben !
00016         if (end == 0l )
00017         m_todoBackEnd = OBackendFactory<OTodoAccessBackend>::Default ("todo", QString::null);
00018 
00019     setBackEnd( m_todoBackEnd );
00020 }
00021 OTodoAccess::~OTodoAccess() {
00022 //    qWarning("~OTodoAccess");
00023 }
00024 void OTodoAccess::mergeWith( const QValueList<OTodo>& list ) {
00025     QValueList<OTodo>::ConstIterator it;
00026     for ( it = list.begin(); it != list.end(); ++it ) {
00027         replace( (*it) );
00028     }
00029 }
00030 OTodoAccess::List OTodoAccess::effectiveToDos( const QDate& start,
00031                                                const QDate& end,
00032                                                bool includeNoDates ) {
00033     QArray<int> ints = m_todoBackEnd->effectiveToDos( start, end, includeNoDates );
00034 
00035     List lis( ints, this );
00036     return lis;
00037 }
00038 OTodoAccess::List OTodoAccess::effectiveToDos( const QDate& start,
00039                                                bool includeNoDates ) {
00040     return effectiveToDos( start, QDate::currentDate(),
00041                            includeNoDates );
00042 }
00043 OTodoAccess::List OTodoAccess::overDue() {
00044     List lis( m_todoBackEnd->overDue(), this );
00045     return lis;
00046 }
00047 /* sort order */
00048 OTodoAccess::List OTodoAccess::sorted( bool ascending, int sort,int filter, int cat ) {
00049     QArray<int> ints = m_todoBackEnd->sorted( ascending, sort,
00050                                       filter, cat );
00051     OTodoAccess::List list( ints, this );
00052     return list;
00053 }
00054 void OTodoAccess::removeAllCompleted() {
00055     m_todoBackEnd->removeAllCompleted();
00056 }
00057 QBitArray OTodoAccess::backendSupport( const QString& ) const{
00058     return m_todoBackEnd->supports();
00059 }
00060 bool OTodoAccess::backendSupports( int attr,  const QString& ar) const{
00061     return backendSupport(ar).testBit( attr );
00062 }
KDE Logo
This file is part of the documentation for OPIE Version 1.1.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:25:21 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001