Diffstat (limited to 'libopie2/opiepim/backend/otodoaccesssql.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/otodoaccesssql.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libopie2/opiepim/backend/otodoaccesssql.h b/libopie2/opiepim/backend/otodoaccesssql.h index e945863..0ae2591 100644 --- a/libopie2/opiepim/backend/otodoaccesssql.h +++ b/libopie2/opiepim/backend/otodoaccesssql.h | |||
@@ -12,77 +12,81 @@ | |||
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | #ifndef OPIE_PIM_ACCESS_SQL_H | 29 | #ifndef OPIE_PIM_ACCESS_SQL_H |
30 | #define OPIE_PIM_ACCESS_SQL_H | 30 | #define OPIE_PIM_ACCESS_SQL_H |
31 | 31 | ||
32 | #include <qasciidict.h> | 32 | #include <qasciidict.h> |
33 | 33 | ||
34 | #include <opie2/otodoaccessbackend.h> | 34 | #include <opie2/otodoaccessbackend.h> |
35 | 35 | ||
36 | namespace Opie { | ||
37 | namespace DB { | ||
36 | class OSQLDriver; | 38 | class OSQLDriver; |
37 | class OSQLResult; | 39 | class OSQLResult; |
38 | class OSQLResultItem; | 40 | class OSQLResultItem; |
41 | } | ||
42 | } | ||
39 | 43 | ||
40 | namespace Opie { | 44 | namespace Opie { |
41 | 45 | ||
42 | class OPimTodoAccessBackendSQL : public OPimTodoAccessBackend { | 46 | class OPimTodoAccessBackendSQL : public OPimTodoAccessBackend { |
43 | public: | 47 | public: |
44 | OPimTodoAccessBackendSQL( const QString& file ); | 48 | OPimTodoAccessBackendSQL( const QString& file ); |
45 | ~OPimTodoAccessBackendSQL(); | 49 | ~OPimTodoAccessBackendSQL(); |
46 | 50 | ||
47 | bool load(); | 51 | bool load(); |
48 | bool reload(); | 52 | bool reload(); |
49 | bool save(); | 53 | bool save(); |
50 | QArray<int> allRecords()const; | 54 | QArray<int> allRecords()const; |
51 | 55 | ||
52 | QArray<int> queryByExample( const OPimTodo& t, int settings, const QDateTime& d = QDateTime() ); | 56 | QArray<int> queryByExample( const OPimTodo& t, int settings, const QDateTime& d = QDateTime() ); |
53 | OPimTodo find(int uid)const; | 57 | OPimTodo find(int uid)const; |
54 | OPimTodo find(int uid, const QArray<int>&, uint cur, Frontend::CacheDirection )const; | 58 | OPimTodo find(int uid, const QArray<int>&, uint cur, Frontend::CacheDirection )const; |
55 | void clear(); | 59 | void clear(); |
56 | bool add( const OPimTodo& t ); | 60 | bool add( const OPimTodo& t ); |
57 | bool remove( int uid ); | 61 | bool remove( int uid ); |
58 | bool replace( const OPimTodo& t ); | 62 | bool replace( const OPimTodo& t ); |
59 | 63 | ||
60 | QArray<int> overDue(); | 64 | QArray<int> overDue(); |
61 | QArray<int> effectiveToDos( const QDate& start, | 65 | QArray<int> effectiveToDos( const QDate& start, |
62 | const QDate& end, bool includeNoDates ); | 66 | const QDate& end, bool includeNoDates ); |
63 | QArray<int> sorted(bool asc, int sortOrder, int sortFilter, int cat ); | 67 | QArray<int> sorted(bool asc, int sortOrder, int sortFilter, int cat ); |
64 | 68 | ||
65 | QBitArray supports()const; | 69 | QBitArray supports()const; |
66 | QArray<int> matchRegexp( const QRegExp &r ) const; | 70 | QArray<int> matchRegexp( const QRegExp &r ) const; |
67 | void removeAllCompleted(); | 71 | void removeAllCompleted(); |
68 | 72 | ||
69 | 73 | ||
70 | private: | 74 | private: |
71 | void update()const; | 75 | void update()const; |
72 | void fillDict(); | 76 | void fillDict(); |
73 | inline bool date( QDate& date, const QString& )const; | 77 | inline bool date( QDate& date, const QString& )const; |
74 | inline OPimTodo todo( const OSQLResult& )const; | 78 | inline OPimTodo todo( const Opie::DB::OSQLResult& )const; |
75 | inline OPimTodo todo( OSQLResultItem& )const; | 79 | inline OPimTodo todo( Opie::DB::OSQLResultItem& )const; |
76 | inline QArray<int> uids( const OSQLResult& )const; | 80 | inline QArray<int> uids( const Opie::DB::OSQLResult& )const; |
77 | OPimTodo todo( int uid )const; | 81 | OPimTodo todo( int uid )const; |
78 | QBitArray sup() const; | 82 | QBitArray sup() const; |
79 | 83 | ||
80 | QAsciiDict<int> m_dict; | 84 | QAsciiDict<int> m_dict; |
81 | OSQLDriver* m_driver; | 85 | Opie::DB::OSQLDriver* m_driver; |
82 | QArray<int> m_uids; | 86 | QArray<int> m_uids; |
83 | bool m_dirty : 1; | 87 | bool m_dirty : 1; |
84 | }; | 88 | }; |
85 | 89 | ||
86 | } | 90 | } |
87 | 91 | ||
88 | #endif | 92 | #endif |