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