summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/otodoaccessxml.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/backend/otodoaccessxml.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/otodoaccessxml.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/libopie2/opiepim/backend/otodoaccessxml.h b/libopie2/opiepim/backend/otodoaccessxml.h
new file mode 100644
index 0000000..be9109d
--- a/dev/null
+++ b/libopie2/opiepim/backend/otodoaccessxml.h
@@ -0,0 +1,53 @@
1#ifndef OPIE_TODO_ACCESS_XML_H
2#define OPIE_TODO_ACCESS_XML_H
3
4#include <qasciidict.h>
5#include <qmap.h>
6
7#include "otodoaccessbackend.h"
8
9namespace Opie {
10 class XMLElement;
11};
12
13class OTodoAccessXML : public OTodoAccessBackend {
14public:
15 /**
16 * fileName if Empty we will use the default path
17 */
18 OTodoAccessXML( const QString& appName,
19 const QString& fileName = QString::null );
20 ~OTodoAccessXML();
21
22 bool load();
23 bool reload();
24 bool save();
25
26 QArray<int> allRecords()const;
27 QArray<int> queryByExample( const OTodo&, int sort );
28 OTodo find( int uid )const;
29 void clear();
30 bool add( const OTodo& );
31 bool remove( int uid );
32 bool replace( const OTodo& );
33
34 /* our functions */
35 QArray<int> effectiveToDos( const QDate& start,
36 const QDate& end,
37 bool includeNoDates );
38 QArray<int> overDue();
39private:
40 OTodo todo( QAsciiDict<int>*, Opie::XMLElement* )const;
41 QString toString( const OTodo& )const;
42 QString toString( const QArray<int>& ints ) const;
43 QMap<int, OTodo> m_events;
44 QString m_file;
45 QString m_app;
46 bool m_opened : 1;
47 bool m_changed : 1;
48 class OTodoAccessXMLPrivate;
49 OTodoAccessXMLPrivate* d;
50
51};
52
53#endif