From acd2d0062dd87635feb03927663b1f700305d67b Mon Sep 17 00:00:00 2001 From: zecke Date: Mon, 07 Oct 2002 09:10:05 +0000 Subject: First SQL backend Resource The DB layout is not fully what we've in mind but for example I do lack the Categories infrastructure for that I've to implement sorted lists and then I'll make Todolist fast --- (limited to 'libopie/pim/otodoaccesssql.h') diff --git a/libopie/pim/otodoaccesssql.h b/libopie/pim/otodoaccesssql.h new file mode 100644 index 0000000..966628d --- a/dev/null +++ b/libopie/pim/otodoaccesssql.h @@ -0,0 +1,46 @@ +#ifndef OPIE_PIM_ACCESS_SQL_H +#define OPIE_PIM_ACCESS_SQL_H + +#include + +#include "otodoaccessbackend.h" + +class OSQLDriver; +class OSQLResult; +class OTodoAccessBackendSQL : public OTodoAccessBackend { +public: + OTodoAccessBackendSQL( const QString& file ); + ~OTodoAccessBackendSQL(); + + bool load(); + bool reload(); + bool save(); + QArray allRecords()const; + + QArray queryByExample( const OTodo& t, int sort ); + OTodo find(int uid)const; + void clear(); + bool add( const OTodo& t ); + bool remove( int uid ); + bool replace( const OTodo& t ); + + QArray overDue(); + QArray effectiveToDos( const QDate& start, + const QDate& end, bool includeNoDates ); + QArray sorted(bool asc, int sortOrder, int sortFilter, int cat ); + +private: + void update(); + void fillDict(); + bool date( QDate& date, const QString& )const; + OTodo todo( const OSQLResult& )const; + QArray uids( const OSQLResult& )const; + OTodo todo( int uid )const; + + QAsciiDict m_dict; + OSQLDriver* m_driver; + QArray m_uids; +}; + + +#endif -- cgit v0.9.0.2