Diffstat (limited to 'libopie/pim/odatebookaccessbackend_sql.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/pim/odatebookaccessbackend_sql.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie/pim/odatebookaccessbackend_sql.h b/libopie/pim/odatebookaccessbackend_sql.h index 85e0d4f..f39e154 100644 --- a/libopie/pim/odatebookaccessbackend_sql.h +++ b/libopie/pim/odatebookaccessbackend_sql.h | |||
@@ -1,60 +1,62 @@ | |||
1 | #ifndef OPIE_DATE_BOOK_ACCESS_BACKEND_SQL__H | 1 | #ifndef OPIE_DATE_BOOK_ACCESS_BACKEND_SQL__H |
2 | #define OPIE_DATE_BOOK_ACCESS_BACKEND_SQL__H | 2 | #define OPIE_DATE_BOOK_ACCESS_BACKEND_SQL__H |
3 | 3 | ||
4 | #include <qmap.h> | 4 | #include <qmap.h> |
5 | #include <opie2/osqlresult.h> | ||
5 | 6 | ||
6 | #include "odatebookaccessbackend.h" | 7 | #include "odatebookaccessbackend.h" |
7 | 8 | ||
8 | class OSQLDriver; | 9 | class OSQLDriver; |
9 | 10 | ||
10 | /** | 11 | /** |
11 | * This is the default SQL implementation for DateBoook SQL storage | 12 | * This is the default SQL implementation for DateBoook SQL storage |
12 | * It fully implements the interface | 13 | * It fully implements the interface |
13 | * @see ODateBookAccessBackend | 14 | * @see ODateBookAccessBackend |
14 | * @see OPimAccessBackend | 15 | * @see OPimAccessBackend |
15 | */ | 16 | */ |
16 | class ODateBookAccessBackend_SQL : public ODateBookAccessBackend { | 17 | class ODateBookAccessBackend_SQL : public ODateBookAccessBackend { |
17 | public: | 18 | public: |
18 | ODateBookAccessBackend_SQL( const QString& appName, | 19 | ODateBookAccessBackend_SQL( const QString& appName, |
19 | const QString& fileName = QString::null); | 20 | const QString& fileName = QString::null); |
20 | ~ODateBookAccessBackend_SQL(); | 21 | ~ODateBookAccessBackend_SQL(); |
21 | 22 | ||
22 | bool load(); | 23 | bool load(); |
23 | bool reload(); | 24 | bool reload(); |
24 | bool save(); | 25 | bool save(); |
25 | 26 | ||
26 | QArray<int> allRecords()const; | 27 | QArray<int> allRecords()const; |
27 | QArray<int> matchRegexp(const QRegExp &r) const; | 28 | QArray<int> matchRegexp(const QRegExp &r) const; |
28 | QArray<int> queryByExample( const OEvent&, int, const QDateTime& d = QDateTime() ); | 29 | QArray<int> queryByExample( const OEvent&, int, const QDateTime& d = QDateTime() ); |
29 | OEvent find( int uid )const; | 30 | OEvent find( int uid )const; |
30 | void clear(); | 31 | void clear(); |
31 | bool add( const OEvent& ev ); | 32 | bool add( const OEvent& ev ); |
32 | bool remove( int uid ); | 33 | bool remove( int uid ); |
33 | bool replace( const OEvent& ev ); | 34 | bool replace( const OEvent& ev ); |
34 | 35 | ||
35 | QArray<UID> rawEvents()const; | 36 | QArray<UID> rawEvents()const; |
36 | QArray<UID> rawRepeats()const; | 37 | QArray<UID> rawRepeats()const; |
37 | QArray<UID> nonRepeats()const; | 38 | QArray<UID> nonRepeats()const; |
38 | 39 | ||
39 | OEvent::ValueList directNonRepeats(); | 40 | OEvent::ValueList directNonRepeats(); |
40 | OEvent::ValueList directRawRepeats(); | 41 | OEvent::ValueList directRawRepeats(); |
41 | 42 | ||
42 | private: | 43 | private: |
43 | bool loadFile(); | 44 | bool loadFile(); |
44 | QString m_fileName; | 45 | QString m_fileName; |
45 | QArray<int> m_uids; | 46 | QArray<int> m_uids; |
46 | 47 | ||
47 | QMap<int, QString> m_fieldMap; | 48 | QMap<int, QString> m_fieldMap; |
49 | QMap<QString, int> m_reverseFieldMap; | ||
48 | 50 | ||
49 | OSQLDriver* m_driver; | 51 | OSQLDriver* m_driver; |
50 | 52 | ||
51 | class Private; | 53 | class Private; |
52 | Private *d; | 54 | Private *d; |
53 | 55 | ||
54 | void initFields(); | 56 | void initFields(); |
55 | void update(); | 57 | void update(); |
56 | QArray<int> extractUids( OSQLResult& res ) const; | 58 | QArray<int> extractUids( OSQLResult& res ) const; |
57 | 59 | ||
58 | }; | 60 | }; |
59 | 61 | ||
60 | #endif | 62 | #endif |