summaryrefslogtreecommitdiff
path: root/noncore/unsupported/libopie/pim/odatebookaccess.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/libopie/pim/odatebookaccess.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/unsupported/libopie/pim/odatebookaccess.cpp81
1 files changed, 81 insertions, 0 deletions
diff --git a/noncore/unsupported/libopie/pim/odatebookaccess.cpp b/noncore/unsupported/libopie/pim/odatebookaccess.cpp
new file mode 100644
index 0000000..d95fed6
--- a/dev/null
+++ b/noncore/unsupported/libopie/pim/odatebookaccess.cpp
@@ -0,0 +1,81 @@
1#include "obackendfactory.h"
2#include "odatebookaccess.h"
3
4/**
5 * Simple constructor
6 * It takes a ODateBookAccessBackend as parent. If it is 0 the default implementation
7 * will be used!
8 * @param back The backend to be used or 0 for the default backend
9 * @param ac What kind of access is intended
10 */
11ODateBookAccess::ODateBookAccess( ODateBookAccessBackend* back, enum Access ac )
12 : OPimAccessTemplate<OEvent>( back )
13{
14 if (!back )
15 back = OBackendFactory<ODateBookAccessBackend>::Default("datebook", QString::null );
16
17 m_backEnd = back;
18 setBackEnd( m_backEnd );
19}
20ODateBookAccess::~ODateBookAccess() {
21}
22
23/**
24 * @return all events available
25 */
26ODateBookAccess::List ODateBookAccess::rawEvents()const {
27 QArray<int> ints = m_backEnd->rawEvents();
28
29 List lis( ints, this );
30 return lis;
31}
32
33/**
34 * @return all repeating events
35 */
36ODateBookAccess::List ODateBookAccess::rawRepeats()const {
37 QArray<int> ints = m_backEnd->rawRepeats();
38
39 List lis( ints, this );
40 return lis;
41}
42
43/**
44 * @return all non repeating events
45 */
46ODateBookAccess::List ODateBookAccess::nonRepeats()const {
47 QArray<int> ints = m_backEnd->nonRepeats();
48
49 List lis( ints, this );
50 return lis;
51}
52
53/**
54 * @return dates in the time span between from and to
55 * @param from Include all events from...
56 * @param to Include all events to...
57 */
58OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDate& from, const QDate& to ) const {
59 return m_backEnd->effectiveEvents( from, to );
60}
61/**
62 * @return all events at a given datetime
63 */
64OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDateTime& start ) const {
65 return m_backEnd->effectiveEvents( start );
66}
67
68/**
69 * @return non repeating dates in the time span between from and to
70 * @param from Include all events from...
71 * @param to Include all events to...
72 */
73OEffectiveEvent::ValueList ODateBookAccess::effectiveNonRepeatingEvents( const QDate& from, const QDate& to ) const {
74 return m_backEnd->effectiveNonRepeatingEvents( from, to );
75}
76/**
77 * @return all non repeating events at a given datetime
78 */
79OEffectiveEvent::ValueList ODateBookAccess::effectiveNonRepeatingEvents( const QDateTime& start ) const {
80 return m_backEnd->effectiveNonRepeatingEvents( start );
81}