author | zecke <zecke> | 2002-10-07 09:10:05 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-07 09:10:05 (UTC) |
commit | acd2d0062dd87635feb03927663b1f700305d67b (patch) (unidiff) | |
tree | 179217749ec7ba3217ca71f80a6e1064f249d1b0 /libopie/pim/otodoaccesssql.h | |
parent | de56dc7c5a21cbd70e9d1e66ab68ca95a277c45c (diff) | |
download | opie-acd2d0062dd87635feb03927663b1f700305d67b.zip opie-acd2d0062dd87635feb03927663b1f700305d67b.tar.gz opie-acd2d0062dd87635feb03927663b1f700305d67b.tar.bz2 |
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
-rw-r--r-- | libopie/pim/otodoaccesssql.h | 46 |
1 files changed, 46 insertions, 0 deletions
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 @@ | |||
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 | ||