otodoaccesssql.h
Go to the documentation of this file.00001 #ifndef OPIE_PIM_ACCESS_SQL_H
00002 #define OPIE_PIM_ACCESS_SQL_H
00003
00004 #include <qasciidict.h>
00005
00006 #include "otodoaccessbackend.h"
00007
00008 class OSQLDriver;
00009 class OSQLResult;
00010 class OSQLResultItem;
00011 class OTodoAccessBackendSQL : public OTodoAccessBackend {
00012 public:
00013 OTodoAccessBackendSQL( const QString& file );
00014 ~OTodoAccessBackendSQL();
00015
00016 bool load();
00017 bool reload();
00018 bool save();
00019 QArray<int> allRecords()const;
00020
00021 QArray<int> queryByExample( const OTodo& t, int settings, const QDateTime& d = QDateTime() );
00022 OTodo find(int uid)const;
00023 OTodo find(int uid, const QArray<int>&, uint cur, Frontend::CacheDirection )const;
00024 void clear();
00025 bool add( const OTodo& t );
00026 bool remove( int uid );
00027 bool replace( const OTodo& t );
00028
00029 QArray<int> overDue();
00030 QArray<int> effectiveToDos( const QDate& start,
00031 const QDate& end, bool includeNoDates );
00032 QArray<int> sorted(bool asc, int sortOrder, int sortFilter, int cat );
00033
00034 QBitArray supports()const;
00035 QArray<int> matchRegexp( const QRegExp &r ) const;
00036 void removeAllCompleted();
00037
00038
00039 private:
00040 void update()const;
00041 void fillDict();
00042 inline bool date( QDate& date, const QString& )const;
00043 inline OTodo todo( const OSQLResult& )const;
00044 inline OTodo todo( OSQLResultItem& )const;
00045 inline QArray<int> uids( const OSQLResult& )const;
00046 OTodo todo( int uid )const;
00047 QBitArray sup() const;
00048
00049 QAsciiDict<int> m_dict;
00050 OSQLDriver* m_driver;
00051 QArray<int> m_uids;
00052 bool m_dirty : 1;
00053 };
00054
00055
00056 #endif
This file is part of the documentation for OPIE Version 1.1.