Diffstat (limited to 'libopie2/opiepim/core/odatebookaccess.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/odatebookaccess.cpp | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/libopie2/opiepim/core/odatebookaccess.cpp b/libopie2/opiepim/core/odatebookaccess.cpp index 440ee0a..32fbb7d 100644 --- a/libopie2/opiepim/core/odatebookaccess.cpp +++ b/libopie2/opiepim/core/odatebookaccess.cpp | |||
@@ -36,33 +36,24 @@ namespace Opie { | |||
36 | * Simple constructor | 36 | * Simple constructor |
37 | * It takes a ODateBookAccessBackend as parent. If it is 0 the default implementation | 37 | * It takes a ODateBookAccessBackend as parent. If it is 0 the default implementation |
38 | * will be used! | 38 | * will be used! |
39 | * @param back The backend to be used or 0 for the default backend | 39 | * @param back The backend to be used or 0 for the default backend |
40 | * @param ac What kind of access is intended | 40 | * @param ac What kind of access is intended |
41 | */ | 41 | */ |
42 | ODateBookAccess::ODateBookAccess( ODateBookAccessBackend* back, enum Access ac ) | 42 | ODateBookAccess::ODateBookAccess( ODateBookAccessBackend* back, enum Access ) |
43 | : OPimAccessTemplate<OPimEvent>( back ) | 43 | : OPimAccessTemplate<OPimEvent>( back ) |
44 | { | 44 | { |
45 | if (!back ) | 45 | if (!back ) |
46 | back = OBackendFactory<ODateBookAccessBackend>::defaultBackend( OPimGlobal::DATEBOOK, QString::null ); | 46 | back = OBackendFactory<ODateBookAccessBackend>::defaultBackend( OPimGlobal::DATEBOOK, QString::null ); |
47 | 47 | ||
48 | m_backEnd = back; | 48 | m_backEnd = back; |
49 | setBackEnd( m_backEnd ); | 49 | setBackEnd( m_backEnd ); |
50 | } | 50 | } |
51 | ODateBookAccess::~ODateBookAccess() { | 51 | ODateBookAccess::~ODateBookAccess() { |
52 | } | 52 | } |
53 | 53 | ||
54 | /** | ||
55 | * @return all events available | ||
56 | */ | ||
57 | ODateBookAccess::List ODateBookAccess::rawEvents()const { | ||
58 | QArray<int> ints = m_backEnd->rawEvents(); | ||
59 | |||
60 | List lis( ints, this ); | ||
61 | return lis; | ||
62 | } | ||
63 | 54 | ||
64 | /** | 55 | /** |
65 | * @return all repeating events | 56 | * @return all repeating events |
66 | */ | 57 | */ |
67 | ODateBookAccess::List ODateBookAccess::rawRepeats()const { | 58 | ODateBookAccess::List ODateBookAccess::rawRepeats()const { |
68 | QArray<int> ints = m_backEnd->rawRepeats(); | 59 | QArray<int> ints = m_backEnd->rawRepeats(); |
@@ -79,40 +70,26 @@ ODateBookAccess::List ODateBookAccess::nonRepeats()const { | |||
79 | 70 | ||
80 | List lis( ints, this ); | 71 | List lis( ints, this ); |
81 | return lis; | 72 | return lis; |
82 | } | 73 | } |
83 | 74 | ||
84 | /** | 75 | /** |
85 | * @return dates in the time span between from and to | ||
86 | * @param from Include all events from... | ||
87 | * @param to Include all events to... | ||
88 | */ | ||
89 | OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDate& from, const QDate& to ) const { | ||
90 | return m_backEnd->effectiveEvents( from, to ); | ||
91 | } | ||
92 | /** | ||
93 | * @return all events at a given datetime | ||
94 | */ | ||
95 | OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDateTime& start ) const { | ||
96 | return m_backEnd->effectiveEvents( start ); | ||
97 | } | ||
98 | |||
99 | /** | ||
100 | * @return non repeating dates in the time span between from and to | 76 | * @return non repeating dates in the time span between from and to |
101 | * @param from Include all events from... | 77 | * @param from Include all events from... |
102 | * @param to Include all events to... | 78 | * @param to Include all events to... |
103 | */ | 79 | */ |
104 | OEffectiveEvent::ValueList ODateBookAccess::effectiveNonRepeatingEvents( const QDate& from, const QDate& to ) const { | 80 | OPimOccurrence::List ODateBookAccess::effectiveNonRepeatingEvents( const QDate& from, const QDate& to ) const { |
105 | return m_backEnd->effectiveNonRepeatingEvents( from, to ); | 81 | return OPimBase::convertOccurrenceFromBackend( m_backEnd->effectiveNonRepeatingEvents( from, to ) ); |
106 | } | 82 | } |
107 | /** | 83 | /** |
108 | * @return all non repeating events at a given datetime | 84 | * @return all non repeating events at a given datetime |
109 | */ | 85 | */ |
110 | OEffectiveEvent::ValueList ODateBookAccess::effectiveNonRepeatingEvents( const QDateTime& start ) const { | 86 | OPimOccurrence::List ODateBookAccess::effectiveNonRepeatingEvents( const QDateTime& start ) const { |
111 | return m_backEnd->effectiveNonRepeatingEvents( start ); | 87 | return OPimBase::convertOccurrenceFromBackend( m_backEnd->effectiveNonRepeatingEvents( start ) ); |
112 | } | 88 | } |
89 | |||
113 | int ODateBookAccess::rtti() const | 90 | int ODateBookAccess::rtti() const |
114 | { | 91 | { |
115 | return OPimResolver::DateBook; | 92 | return OPimResolver::DateBook; |
116 | } | 93 | } |
117 | 94 | ||
118 | } | 95 | } |