Diffstat (limited to 'libopie2/opiepim/backend/odatebookaccessbackend.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/odatebookaccessbackend.h | 47 |
1 files changed, 20 insertions, 27 deletions
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend.h b/libopie2/opiepim/backend/odatebookaccessbackend.h index a9cce6a..8927ca1 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend.h +++ b/libopie2/opiepim/backend/odatebookaccessbackend.h | |||
@@ -33,89 +33,82 @@ | |||
33 | 33 | ||
34 | #include <opie2/opimaccessbackend.h> | 34 | #include <opie2/opimaccessbackend.h> |
35 | #include <opie2/opimevent.h> | 35 | #include <opie2/opimevent.h> |
36 | 36 | ||
37 | namespace Opie { | 37 | namespace Opie { |
38 | /** | 38 | /** |
39 | * This class is the interface to the storage of Events. | 39 | * This class is the interface to the storage of Events. |
40 | * @see OPimAccessBackend | 40 | * @see OPimAccessBackend |
41 | * | 41 | * |
42 | */ | 42 | */ |
43 | class ODateBookAccessBackend : public OPimAccessBackend<OPimEvent> { | 43 | class ODateBookAccessBackend : public OPimAccessBackend<OPimEvent> { |
44 | public: | 44 | public: |
45 | typedef int UID; | ||
46 | |||
47 | /** | 45 | /** |
48 | * c'tor without parameter | 46 | * c'tor without parameter |
49 | */ | 47 | */ |
50 | ODateBookAccessBackend(); | 48 | ODateBookAccessBackend(); |
51 | ~ODateBookAccessBackend(); | 49 | ~ODateBookAccessBackend(); |
52 | 50 | ||
53 | /** | 51 | /** |
54 | * This method should return a list of UIDs containing | 52 | * This method should return a list of UIDs containing |
55 | * all events. No filter should be applied | ||
56 | * @return list of events | ||
57 | */ | ||
58 | virtual QArray<UID> rawEvents()const = 0; | ||
59 | |||
60 | /** | ||
61 | * This method should return a list of UIDs containing | ||
62 | * all repeating events. No filter should be applied | 53 | * all repeating events. No filter should be applied |
63 | * @return list of repeating events | 54 | * @return list of repeating events |
64 | */ | 55 | */ |
65 | virtual QArray<UID> rawRepeats()const = 0; | 56 | virtual UIDArray rawRepeats()const = 0; |
66 | 57 | ||
67 | /** | 58 | /** |
68 | * This mthod should return a list of UIDs containing all non | 59 | * This mthod should return a list of UIDs containing all non |
69 | * repeating events. No filter should be applied | 60 | * repeating events. No filter should be applied |
70 | * @return list of nonrepeating events | 61 | * @return list of nonrepeating events |
71 | */ | 62 | */ |
72 | virtual QArray<UID> nonRepeats() const = 0; | 63 | virtual UIDArray nonRepeats() const = 0; |
73 | 64 | ||
74 | /** | 65 | /** |
75 | * If you do not want to implement the effectiveEvents methods below | 66 | * If you do not want to implement the effectiveEvents methods below |
76 | * you need to supply it with directNonRepeats. | 67 | * you need to supply it with directNonRepeats. |
77 | * This method can return empty lists if effectiveEvents is implememted | 68 | * This method can return empty lists if effectiveEvents is implememted |
78 | */ | 69 | */ |
79 | virtual OPimEvent::ValueList directNonRepeats() = 0; | 70 | virtual OPimEvent::ValueList directNonRepeats()const = 0; |
80 | 71 | ||
81 | /** | 72 | /** |
82 | * Same as above but return raw repeats! | 73 | * Same as above but return raw repeats! |
83 | */ | 74 | */ |
84 | virtual OPimEvent::ValueList directRawRepeats() = 0; | 75 | virtual OPimEvent::ValueList directRawRepeats()const = 0; |
85 | 76 | ||
86 | /* is implemented by default but you can reimplement it*/ | 77 | /* is implemented by default but you can reimplement it*/ |
87 | /** | 78 | /** |
88 | * Effective Events are special event occuring during a time frame. This method does calcualte | 79 | * Effective Events are special event occuring during a time frame. This method does calcualte |
89 | * EffectiveEvents bases on the directNonRepeats and directRawRepeats. You may implement this method | 80 | * EffectiveEvents bases on the directNonRepeats and directRawRepeats. You may implement this method |
90 | * yourself | 81 | * yourself |
91 | */ | 82 | */ |
92 | virtual OEffectiveEvent::ValueList effectiveEvents( const QDate& from, const QDate& to ); | 83 | virtual OPimBackendOccurrence::List effectiveNonRepeatingEvents( const QDate& from, const QDate& to )const; |
93 | 84 | ||
94 | /** | 85 | /** |
95 | * this is an overloaded member function | 86 | * this is an overloaded member function |
96 | * @see effectiveEvents( const QDate& from, const QDate& to ) | 87 | * @see effectiveNonRepeatingEvents( const QDate& from, const QDate& to ) |
97 | */ | ||
98 | virtual OEffectiveEvent::ValueList effectiveEvents( const QDateTime& start ); | ||
99 | |||
100 | /** | ||
101 | * Effective Events are special event occuring during a time frame. This method does calcualte | ||
102 | * EffectiveEvents bases on the directNonRepeats and directRawRepeats. You may implement this method | ||
103 | * yourself | ||
104 | */ | 88 | */ |
105 | virtual OEffectiveEvent::ValueList effectiveNonRepeatingEvents( const QDate& from, const QDate& to ); | 89 | virtual OPimBackendOccurrence::List effectiveNonRepeatingEvents( const QDateTime& start )const; |
106 | 90 | ||
107 | /** | 91 | /** |
108 | * this is an overloaded member function | 92 | * Common and probably inefficent implementation |
109 | * @see effectiveNonRepeatingEvents( const QDate& from, const QDate& to ) | 93 | * for queryByExample, sorted |
94 | * and occurrences | ||
110 | */ | 95 | */ |
111 | virtual OEffectiveEvent::ValueList effectiveNonRepeatingEvents( const QDateTime& start ); | 96 | //@{ |
112 | 97 | UIDArray queryByExample( const OPimEvent&, int settings, const QDateTime& d = QDateTime() )const; | |
98 | UIDArray sorted( const UIDArray&, bool asc, int, int, const QArray<int>& )const; | ||
99 | OPimBackendOccurrence::List occurrences( const QDate&, const QDate& end )const; | ||
100 | OPimBackendOccurrence::List occurrences( const QDateTime& )const; | ||
101 | //@} | ||
102 | |||
103 | protected: | ||
104 | static OPimBackendOccurrence::List filterOccurrences(const OPimBackendOccurrence::List, | ||
105 | const QDateTime& time ); | ||
113 | private: | 106 | private: |
114 | class Private; | 107 | class Private; |
115 | Private *d; | 108 | Private *d; |
116 | 109 | ||
117 | }; | 110 | }; |
118 | 111 | ||
119 | } | 112 | } |
120 | 113 | ||
121 | #endif | 114 | #endif |