odatebookaccessbackend_xml.h
Go to the documentation of this file.00001 #ifndef OPIE_DATE_BOOK_ACCESS_BACKEND_XML__H 00002 #define OPIE_DATE_BOOK_ACCESS_BACKEND_XML__H 00003 00004 #include <qmap.h> 00005 00006 #include "odatebookaccessbackend.h" 00007 00014 class ODateBookAccessBackend_XML : public ODateBookAccessBackend { 00015 public: 00016 ODateBookAccessBackend_XML( const QString& appName, 00017 const QString& fileName = QString::null); 00018 ~ODateBookAccessBackend_XML(); 00019 00020 bool load(); 00021 bool reload(); 00022 bool save(); 00023 00024 QArray<int> allRecords()const; 00025 QArray<int> matchRegexp(const QRegExp &r) const; 00026 QArray<int> queryByExample( const OEvent&, int, const QDateTime& d = QDateTime() ); 00027 OEvent find( int uid )const; 00028 void clear(); 00029 bool add( const OEvent& ev ); 00030 bool remove( int uid ); 00031 bool replace( const OEvent& ev ); 00032 00033 QArray<UID> rawEvents()const; 00034 QArray<UID> rawRepeats()const; 00035 QArray<UID> nonRepeats()const; 00036 00037 OEvent::ValueList directNonRepeats(); 00038 OEvent::ValueList directRawRepeats(); 00039 00040 private: 00041 bool m_changed :1 ; 00042 bool loadFile(); 00043 inline void finalizeRecord( OEvent& ev ); 00044 inline void setField( OEvent&, int field, const QString& val ); 00045 QString m_name; 00046 QMap<int, OEvent> m_raw; 00047 QMap<int, OEvent> m_rep; 00048 00049 struct Data; 00050 Data* data; 00051 class Private; 00052 Private *d; 00053 }; 00054 00055 #endif
