Diffstat (limited to 'libopie2/opiepim/backend/otodoaccessxml.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessxml.h | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/libopie2/opiepim/backend/otodoaccessxml.h b/libopie2/opiepim/backend/otodoaccessxml.h index e4850a1..d634398 100644 --- a/libopie2/opiepim/backend/otodoaccessxml.h +++ b/libopie2/opiepim/backend/otodoaccessxml.h | |||
@@ -1,60 +1,89 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | Copyright (C) Stefan Eilers (Eilers.Stefan@epost.de) | ||
4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> | ||
5 | .=l. | ||
6 | .>+-= | ||
7 | _;:, .> :=|. This program is free software; you can | ||
8 | .> <`_, > . <= redistribute it and/or modify it under | ||
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
10 | .="- .-=="i, .._ License as published by the Free Software | ||
11 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
12 | ._= =} : or (at your option) any later version. | ||
13 | .%`+i> _;_. | ||
14 | .i_,=:_. -<s. This program is distributed in the hope that | ||
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
16 | : .. .:, . . . without even the implied warranty of | ||
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
19 | ..}^=.= = ; Library General Public License for more | ||
20 | ++= -. .` .: details. | ||
21 | : = ...= . :.=- | ||
22 | -. .:....=;==+<; You should have received a copy of the GNU | ||
23 | -_. . . )=. = Library General Public License along with | ||
24 | -- :-=` this library; see the file COPYING.LIB. | ||
25 | If not, write to the Free Software Foundation, | ||
26 | Inc., 59 Temple Place - Suite 330, | ||
27 | Boston, MA 02111-1307, USA. | ||
28 | */ | ||
1 | #ifndef OPIE_TODO_ACCESS_XML_H | 29 | #ifndef OPIE_TODO_ACCESS_XML_H |
2 | #define OPIE_TODO_ACCESS_XML_H | 30 | #define OPIE_TODO_ACCESS_XML_H |
3 | 31 | ||
4 | #include <qasciidict.h> | 32 | #include <qasciidict.h> |
5 | #include <qmap.h> | 33 | #include <qmap.h> |
6 | 34 | ||
7 | #include "otodoaccessbackend.h" | 35 | #include <opie2/otodoaccessbackend.h> |
8 | 36 | ||
9 | namespace Opie { | 37 | namespace Opie { |
10 | class XMLElement; | 38 | class XMLElement; |
11 | }; | ||
12 | 39 | ||
13 | class OTodoAccessXML : public OTodoAccessBackend { | 40 | class OTodoAccessXML : public OTodoAccessBackend { |
14 | public: | 41 | public: |
15 | /** | 42 | /** |
16 | * fileName if Empty we will use the default path | 43 | * fileName if Empty we will use the default path |
17 | */ | 44 | */ |
18 | OTodoAccessXML( const QString& appName, | 45 | OTodoAccessXML( const QString& appName, |
19 | const QString& fileName = QString::null ); | 46 | const QString& fileName = QString::null ); |
20 | ~OTodoAccessXML(); | 47 | ~OTodoAccessXML(); |
21 | 48 | ||
22 | bool load(); | 49 | bool load(); |
23 | bool reload(); | 50 | bool reload(); |
24 | bool save(); | 51 | bool save(); |
25 | 52 | ||
26 | QArray<int> allRecords()const; | 53 | QArray<int> allRecords()const; |
27 | QArray<int> matchRegexp(const QRegExp &r) const; | 54 | QArray<int> matchRegexp(const QRegExp &r) const; |
28 | QArray<int> queryByExample( const OTodo&, int querysettings, const QDateTime& d = QDateTime() ); | 55 | QArray<int> queryByExample( const OTodo&, int querysettings, const QDateTime& d = QDateTime() ); |
29 | OTodo find( int uid )const; | 56 | OTodo find( int uid )const; |
30 | void clear(); | 57 | void clear(); |
31 | bool add( const OTodo& ); | 58 | bool add( const OTodo& ); |
32 | bool remove( int uid ); | 59 | bool remove( int uid ); |
33 | void removeAllCompleted(); | 60 | void removeAllCompleted(); |
34 | bool replace( const OTodo& ); | 61 | bool replace( const OTodo& ); |
35 | 62 | ||
36 | /* our functions */ | 63 | /* our functions */ |
37 | QArray<int> effectiveToDos( const QDate& start, | 64 | QArray<int> effectiveToDos( const QDate& start, |
38 | const QDate& end, | 65 | const QDate& end, |
39 | bool includeNoDates ); | 66 | bool includeNoDates ); |
40 | QArray<int> overDue(); | 67 | QArray<int> overDue(); |
41 | QArray<int> sorted( bool asc, int sortOrder, | 68 | QArray<int> sorted( bool asc, int sortOrder, |
42 | int sortFilter, int cat ); | 69 | int sortFilter, int cat ); |
43 | QBitArray supports()const; | 70 | QBitArray supports()const; |
44 | private: | 71 | private: |
45 | static QBitArray sup(); | 72 | static QBitArray sup(); |
46 | void todo( QAsciiDict<int>*, OTodo&,const QCString&,const QString& ); | 73 | void todo( QAsciiDict<int>*, OTodo&,const QCString&,const QString& ); |
47 | QString toString( const OTodo& )const; | 74 | QString toString( const OTodo& )const; |
48 | QString toString( const QArray<int>& ints ) const; | 75 | QString toString( const QArray<int>& ints ) const; |
49 | QMap<int, OTodo> m_events; | 76 | QMap<int, OTodo> m_events; |
50 | QString m_file; | 77 | QString m_file; |
51 | QString m_app; | 78 | QString m_app; |
52 | bool m_opened : 1; | 79 | bool m_opened : 1; |
53 | bool m_changed : 1; | 80 | bool m_changed : 1; |
54 | class OTodoAccessXMLPrivate; | 81 | class OTodoAccessXMLPrivate; |
55 | OTodoAccessXMLPrivate* d; | 82 | OTodoAccessXMLPrivate* d; |
56 | int m_year, m_month, m_day; | 83 | int m_year, m_month, m_day; |
57 | 84 | ||
58 | }; | 85 | }; |
59 | 86 | ||
87 | }; | ||
88 | |||
60 | #endif | 89 | #endif |