author | zecke <zecke> | 2003-02-21 20:08:44 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-02-21 20:08:44 (UTC) |
commit | e09381c4b3d482c6b553a61c5fb0502a089dcc5f (patch) (side-by-side diff) | |
tree | c336a21f6b00e09989de5309ca8bb933c9494b09 /libopie2/opiepim/core | |
parent | 3b37e71ad7dd41555763d15a16c691b503780de8 (diff) | |
download | opie-e09381c4b3d482c6b553a61c5fb0502a089dcc5f.zip opie-e09381c4b3d482c6b553a61c5fb0502a089dcc5f.tar.gz opie-e09381c4b3d482c6b553a61c5fb0502a089dcc5f.tar.bz2 |
-Fix hasRecurrence()
-Add the Access(Backend) of DateBook
-rw-r--r-- | libopie2/opiepim/core/odatebookaccess.cpp | 37 | ||||
-rw-r--r-- | libopie2/opiepim/core/odatebookaccess.h | 32 |
2 files changed, 69 insertions, 0 deletions
diff --git a/libopie2/opiepim/core/odatebookaccess.cpp b/libopie2/opiepim/core/odatebookaccess.cpp new file mode 100644 index 0000000..5f97e7c --- a/dev/null +++ b/libopie2/opiepim/core/odatebookaccess.cpp @@ -0,0 +1,37 @@ +#include "obackendfactory.h" +#include "odatebookaccess.h" + +ODateBookAccess::ODateBookAccess( ODateBookAccessBackend* back, enum Access ac ) + : OPimAccessTemplate<OEvent>( back ) +{ + if (!back ) + back = OBackendFactory<ODateBookAccessBackend>::Default("datebook", QString::null ); + + m_backEnd = back; +} +ODateBookAccess::~ODateBookAccess() { +} +ODateBookAccess::List ODateBookAccess::rawEvents()const { + QArray<int> ints = m_backEnd->rawEvents(); + + List lis( ints, this ); + return lis; +} +ODateBookAccess::List ODateBookAccess::rawRepeats()const { + QArray<int> ints = m_backEnd->rawRepeats(); + + List lis( ints, this ); + return lis; +} +ODateBookAccess::List ODateBookAccess::nonRepeats()const { + QArray<int> ints = m_backEnd->nonRepeats(); + + List lis( ints, this ); + return lis; +} +OEffectiveEvent::ValueList ODateBookAccess::effecticeEvents( const QDate& from, const QDate& to ) { + return m_backEnd->effecticeEvents( from, to ); +} +OEffectiveEvent::ValueList ODateBookAccess::effecticeEvents( const QDateTime& start ) { + return m_backEnd->effecticeEvents( start ); +} diff --git a/libopie2/opiepim/core/odatebookaccess.h b/libopie2/opiepim/core/odatebookaccess.h new file mode 100644 index 0000000..3f2c728 --- a/dev/null +++ b/libopie2/opiepim/core/odatebookaccess.h @@ -0,0 +1,32 @@ +#ifndef OPIE_DATE_BOOK_ACCESS_H +#define OPIE_DATE_BOOK_ACCESS_H + +#include "odatebookaccessbackend.h" +#include "opimaccesstemplate.h" + +#include "oevent.h" + +class ODateBookAccess : public OPimAccessTemplate<OEvent> { +public: + ODateBookAccess( ODateBookAccessBackend* = 0l, enum Access acc = Random ); + ~ODateBookAccess(); + + /** return all events */ + List rawEvents()const; + + /** return repeating events */ + List rawRepeats()const; + + /** return non repeating events */ + List nonRepeats()const; + + OEffectiveEvent::ValueList effecticeEvents( const QDate& from, const QDate& to ); + OEffectiveEvent::ValueList effecticeEvents( const QDateTime& start ); + +private: + ODateBookAccessBackend* m_backEnd; + class Private; + Private* d; +}; + +#endif |