Diffstat (limited to 'noncore/unsupported/libopie/pim/odatebookaccessbackend_xml.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/libopie/pim/odatebookaccessbackend_xml.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/noncore/unsupported/libopie/pim/odatebookaccessbackend_xml.h b/noncore/unsupported/libopie/pim/odatebookaccessbackend_xml.h new file mode 100644 index 0000000..a5cc0fc --- a/dev/null +++ b/noncore/unsupported/libopie/pim/odatebookaccessbackend_xml.h | |||
@@ -0,0 +1,55 @@ | |||
1 | #ifndef OPIE_DATE_BOOK_ACCESS_BACKEND_XML__H | ||
2 | #define OPIE_DATE_BOOK_ACCESS_BACKEND_XML__H | ||
3 | |||
4 | #include <qmap.h> | ||
5 | |||
6 | #include "odatebookaccessbackend.h" | ||
7 | |||
8 | /** | ||
9 | * This is the default XML implementation for DateBoook XML storage | ||
10 | * It fully implements the interface | ||
11 | * @see ODateBookAccessBackend | ||
12 | * @see OPimAccessBackend | ||
13 | */ | ||
14 | class ODateBookAccessBackend_XML : public ODateBookAccessBackend { | ||
15 | public: | ||
16 | ODateBookAccessBackend_XML( const QString& appName, | ||
17 | const QString& fileName = QString::null); | ||
18 | ~ODateBookAccessBackend_XML(); | ||
19 | |||
20 | bool load(); | ||
21 | bool reload(); | ||
22 | bool save(); | ||
23 | |||
24 | QArray<int> allRecords()const; | ||
25 | QArray<int> matchRegexp(const QRegExp &r) const; | ||
26 | QArray<int> queryByExample( const OEvent&, int, const QDateTime& d = QDateTime() ); | ||
27 | OEvent find( int uid )const; | ||
28 | void clear(); | ||
29 | bool add( const OEvent& ev ); | ||
30 | bool remove( int uid ); | ||
31 | bool replace( const OEvent& ev ); | ||
32 | |||
33 | QArray<UID> rawEvents()const; | ||
34 | QArray<UID> rawRepeats()const; | ||
35 | QArray<UID> nonRepeats()const; | ||
36 | |||
37 | OEvent::ValueList directNonRepeats(); | ||
38 | OEvent::ValueList directRawRepeats(); | ||
39 | |||
40 | private: | ||
41 | bool m_changed :1 ; | ||
42 | bool loadFile(); | ||
43 | inline void finalizeRecord( OEvent& ev ); | ||
44 | inline void setField( OEvent&, int field, const QString& val ); | ||
45 | QString m_name; | ||
46 | QMap<int, OEvent> m_raw; | ||
47 | QMap<int, OEvent> m_rep; | ||
48 | |||
49 | struct Data; | ||
50 | Data* data; | ||
51 | class Private; | ||
52 | Private *d; | ||
53 | }; | ||
54 | |||
55 | #endif | ||