summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/odatebookaccessbackend_xml.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/backend/odatebookaccessbackend_xml.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/backend/odatebookaccessbackend_xml.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_xml.h b/libopie2/opiepim/backend/odatebookaccessbackend_xml.h
index a5cc0fc..29f5f4f 100644
--- a/libopie2/opiepim/backend/odatebookaccessbackend_xml.h
+++ b/libopie2/opiepim/backend/odatebookaccessbackend_xml.h
@@ -1,55 +1,86 @@
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_DATE_BOOK_ACCESS_BACKEND_XML__H 29#ifndef OPIE_DATE_BOOK_ACCESS_BACKEND_XML__H
2#define OPIE_DATE_BOOK_ACCESS_BACKEND_XML__H 30#define OPIE_DATE_BOOK_ACCESS_BACKEND_XML__H
3 31
4#include <qmap.h> 32#include <qmap.h>
5 33
6#include "odatebookaccessbackend.h" 34#include <opie2/odatebookaccessbackend.h>
7 35
36namespace Opie {
8/** 37/**
9 * This is the default XML implementation for DateBoook XML storage 38 * This is the default XML implementation for DateBoook XML storage
10 * It fully implements the interface 39 * It fully implements the interface
11 * @see ODateBookAccessBackend 40 * @see ODateBookAccessBackend
12 * @see OPimAccessBackend 41 * @see OPimAccessBackend
13 */ 42 */
14class ODateBookAccessBackend_XML : public ODateBookAccessBackend { 43class ODateBookAccessBackend_XML : public ODateBookAccessBackend {
15public: 44public:
16 ODateBookAccessBackend_XML( const QString& appName, 45 ODateBookAccessBackend_XML( const QString& appName,
17 const QString& fileName = QString::null); 46 const QString& fileName = QString::null);
18 ~ODateBookAccessBackend_XML(); 47 ~ODateBookAccessBackend_XML();
19 48
20 bool load(); 49 bool load();
21 bool reload(); 50 bool reload();
22 bool save(); 51 bool save();
23 52
24 QArray<int> allRecords()const; 53 QArray<int> allRecords()const;
25 QArray<int> matchRegexp(const QRegExp &r) const; 54 QArray<int> matchRegexp(const QRegExp &r) const;
26 QArray<int> queryByExample( const OEvent&, int, const QDateTime& d = QDateTime() ); 55 QArray<int> queryByExample( const OEvent&, int, const QDateTime& d = QDateTime() );
27 OEvent find( int uid )const; 56 OEvent find( int uid )const;
28 void clear(); 57 void clear();
29 bool add( const OEvent& ev ); 58 bool add( const OEvent& ev );
30 bool remove( int uid ); 59 bool remove( int uid );
31 bool replace( const OEvent& ev ); 60 bool replace( const OEvent& ev );
32 61
33 QArray<UID> rawEvents()const; 62 QArray<UID> rawEvents()const;
34 QArray<UID> rawRepeats()const; 63 QArray<UID> rawRepeats()const;
35 QArray<UID> nonRepeats()const; 64 QArray<UID> nonRepeats()const;
36 65
37 OEvent::ValueList directNonRepeats(); 66 OEvent::ValueList directNonRepeats();
38 OEvent::ValueList directRawRepeats(); 67 OEvent::ValueList directRawRepeats();
39 68
40private: 69private:
41 bool m_changed :1 ; 70 bool m_changed :1 ;
42 bool loadFile(); 71 bool loadFile();
43 inline void finalizeRecord( OEvent& ev ); 72 inline void finalizeRecord( OEvent& ev );
44 inline void setField( OEvent&, int field, const QString& val ); 73 inline void setField( OEvent&, int field, const QString& val );
45 QString m_name; 74 QString m_name;
46 QMap<int, OEvent> m_raw; 75 QMap<int, OEvent> m_raw;
47 QMap<int, OEvent> m_rep; 76 QMap<int, OEvent> m_rep;
48 77
49 struct Data; 78 struct Data;
50 Data* data; 79 Data* data;
51 class Private; 80 class Private;
52 Private *d; 81 Private *d;
53}; 82};
54 83
84}
85
55#endif 86#endif