Diffstat (limited to 'libopie/pim/otodoaccesssql.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/pim/otodoaccesssql.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libopie/pim/otodoaccesssql.h b/libopie/pim/otodoaccesssql.h index 1c55567..72214de 100644 --- a/libopie/pim/otodoaccesssql.h +++ b/libopie/pim/otodoaccesssql.h | |||
@@ -1,22 +1,27 @@ | |||
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 | ||
8 | namespace Opie{ | ||
9 | namespace DB { | ||
8 | class OSQLDriver; | 10 | class OSQLDriver; |
9 | class OSQLResult; | 11 | class OSQLResult; |
10 | class OSQLResultItem; | 12 | class OSQLResultItem; |
13 | } | ||
14 | } | ||
15 | |||
11 | class OTodoAccessBackendSQL : public OTodoAccessBackend { | 16 | class OTodoAccessBackendSQL : public OTodoAccessBackend { |
12 | public: | 17 | public: |
13 | OTodoAccessBackendSQL( const QString& file ); | 18 | OTodoAccessBackendSQL( const QString& file ); |
14 | ~OTodoAccessBackendSQL(); | 19 | ~OTodoAccessBackendSQL(); |
15 | 20 | ||
16 | bool load(); | 21 | bool load(); |
17 | bool reload(); | 22 | bool reload(); |
18 | bool save(); | 23 | bool save(); |
19 | QArray<int> allRecords()const; | 24 | QArray<int> allRecords()const; |
20 | 25 | ||
21 | QArray<int> queryByExample( const OTodo& t, int settings, const QDateTime& d = QDateTime() ); | 26 | QArray<int> queryByExample( const OTodo& t, int settings, const QDateTime& d = QDateTime() ); |
22 | OTodo find(int uid)const; | 27 | OTodo find(int uid)const; |
@@ -31,26 +36,26 @@ public: | |||
31 | const QDate& end, bool includeNoDates ); | 36 | const QDate& end, bool includeNoDates ); |
32 | QArray<int> sorted(bool asc, int sortOrder, int sortFilter, int cat ); | 37 | QArray<int> sorted(bool asc, int sortOrder, int sortFilter, int cat ); |
33 | 38 | ||
34 | QBitArray supports()const; | 39 | QBitArray supports()const; |
35 | QArray<int> matchRegexp( const QRegExp &r ) const; | 40 | QArray<int> matchRegexp( const QRegExp &r ) const; |
36 | void removeAllCompleted(); | 41 | void removeAllCompleted(); |
37 | 42 | ||
38 | 43 | ||
39 | private: | 44 | private: |
40 | void update()const; | 45 | void update()const; |
41 | void fillDict(); | 46 | void fillDict(); |
42 | inline bool date( QDate& date, const QString& )const; | 47 | inline bool date( QDate& date, const QString& )const; |
43 | inline OTodo todo( const OSQLResult& )const; | 48 | inline OTodo todo( const Opie::DB::OSQLResult& )const; |
44 | inline OTodo todo( OSQLResultItem& )const; | 49 | inline OTodo todo( Opie::DB::OSQLResultItem& )const; |
45 | inline QArray<int> uids( const OSQLResult& )const; | 50 | inline QArray<int> uids( const Opie::DB::OSQLResult& )const; |
46 | OTodo todo( int uid )const; | 51 | OTodo todo( int uid )const; |
47 | QBitArray sup() const; | 52 | QBitArray sup() const; |
48 | 53 | ||
49 | QAsciiDict<int> m_dict; | 54 | QAsciiDict<int> m_dict; |
50 | OSQLDriver* m_driver; | 55 | Opie::DB::OSQLDriver* m_driver; |
51 | QArray<int> m_uids; | 56 | QArray<int> m_uids; |
52 | bool m_dirty : 1; | 57 | bool m_dirty : 1; |
53 | }; | 58 | }; |
54 | 59 | ||
55 | 60 | ||
56 | #endif | 61 | #endif |