summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/otodoaccesssql.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/backend/otodoaccesssql.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/otodoaccesssql.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libopie2/opiepim/backend/otodoaccesssql.h b/libopie2/opiepim/backend/otodoaccesssql.h
index 6c5f50a..c1aa2ed 100644
--- a/libopie2/opiepim/backend/otodoaccesssql.h
+++ b/libopie2/opiepim/backend/otodoaccesssql.h
@@ -1,46 +1,49 @@
1#ifndef OPIE_PIM_ACCESS_SQL_H 1#ifndef OPIE_PIM_ACCESS_SQL_H
2#define OPIE_PIM_ACCESS_SQL_H 2#define OPIE_PIM_ACCESS_SQL_H
3 3
4#include <qasciidict.h> 4#include <qasciidict.h>
5 5
6#include "otodoaccessbackend.h" 6#include "otodoaccessbackend.h"
7 7
8class OSQLDriver; 8class OSQLDriver;
9class OSQLResult; 9class OSQLResult;
10class OSQLResultItem;
10class OTodoAccessBackendSQL : public OTodoAccessBackend { 11class OTodoAccessBackendSQL : public OTodoAccessBackend {
11public: 12public:
12 OTodoAccessBackendSQL( const QString& file ); 13 OTodoAccessBackendSQL( const QString& file );
13 ~OTodoAccessBackendSQL(); 14 ~OTodoAccessBackendSQL();
14 15
15 bool load(); 16 bool load();
16 bool reload(); 17 bool reload();
17 bool save(); 18 bool save();
18 QArray<int> allRecords()const; 19 QArray<int> allRecords()const;
19 20
20 QArray<int> queryByExample( const OTodo& t, int sort ); 21 QArray<int> queryByExample( const OTodo& t, int sort );
21 OTodo find(int uid)const; 22 OTodo find(int uid)const;
23 OTodo find(int uid, const QArray<int>&, uint cur, Frontend::CacheDirection )const;
22 void clear(); 24 void clear();
23 bool add( const OTodo& t ); 25 bool add( const OTodo& t );
24 bool remove( int uid ); 26 bool remove( int uid );
25 bool replace( const OTodo& t ); 27 bool replace( const OTodo& t );
26 28
27 QArray<int> overDue(); 29 QArray<int> overDue();
28 QArray<int> effectiveToDos( const QDate& start, 30 QArray<int> effectiveToDos( const QDate& start,
29 const QDate& end, bool includeNoDates ); 31 const QDate& end, bool includeNoDates );
30 QArray<int> sorted(bool asc, int sortOrder, int sortFilter, int cat ); 32 QArray<int> sorted(bool asc, int sortOrder, int sortFilter, int cat );
31 33
32private: 34private:
33 void update(); 35 void update();
34 void fillDict(); 36 void fillDict();
35 inline bool date( QDate& date, const QString& )const; 37 inline bool date( QDate& date, const QString& )const;
36 inline OTodo todo( const OSQLResult& )const; 38 inline OTodo todo( const OSQLResult& )const;
39 inline OTodo todo( OSQLResultItem& )const;
37 inline QArray<int> uids( const OSQLResult& )const; 40 inline QArray<int> uids( const OSQLResult& )const;
38 OTodo todo( int uid )const; 41 OTodo todo( int uid )const;
39 42
40 QAsciiDict<int> m_dict; 43 QAsciiDict<int> m_dict;
41 OSQLDriver* m_driver; 44 OSQLDriver* m_driver;
42 QArray<int> m_uids; 45 QArray<int> m_uids;
43}; 46};
44 47
45 48
46#endif 49#endif