Diffstat (limited to 'libopie/pim/opimaccesstemplate.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/pim/opimaccesstemplate.h | 53 |
1 files changed, 29 insertions, 24 deletions
diff --git a/libopie/pim/opimaccesstemplate.h b/libopie/pim/opimaccesstemplate.h index 36f5a99..31ab516 100644 --- a/libopie/pim/opimaccesstemplate.h +++ b/libopie/pim/opimaccesstemplate.h | |||
@@ -15,5 +15,5 @@ | |||
15 | * interface or you want to implement | 15 | * interface or you want to implement |
16 | * your own Access lib | 16 | * your own Access lib |
17 | * Just create a OPimRecord and inherit from | 17 | * Just create a OPimRecord and inherit from |
18 | * the plugins | 18 | * the plugins |
19 | */ | 19 | */ |
@@ -37,19 +37,19 @@ public: | |||
37 | OPimAccessTemplate( BackEnd* end); | 37 | OPimAccessTemplate( BackEnd* end); |
38 | virtual ~OPimAccessTemplate(); | 38 | virtual ~OPimAccessTemplate(); |
39 | 39 | ||
40 | /** | 40 | /** |
41 | * load from the backend | 41 | * load from the backend |
42 | */ | 42 | */ |
43 | virtual void load(); | 43 | virtual bool load(); |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * reload from the backend | 46 | * reload from the backend |
47 | */ | 47 | */ |
48 | virtual void reload(); | 48 | virtual bool reload(); |
49 | 49 | ||
50 | /** | 50 | /** |
51 | * save to the backend | 51 | * save to the backend |
52 | */ | 52 | */ |
53 | virtual void save(); | 53 | virtual bool save(); |
54 | 54 | ||
55 | /** | 55 | /** |
@@ -57,5 +57,5 @@ public: | |||
57 | */ | 57 | */ |
58 | bool wasChangedExternally()const; | 58 | bool wasChangedExternally()const; |
59 | 59 | ||
60 | /** | 60 | /** |
61 | * return a List of records | 61 | * return a List of records |
@@ -63,14 +63,14 @@ public: | |||
63 | */ | 63 | */ |
64 | virtual List allRecords()const; | 64 | virtual List allRecords()const; |
65 | 65 | ||
66 | /** | 66 | /** |
67 | * queryByExample | 67 | * queryByExample |
68 | */ | 68 | */ |
69 | virtual List queryByExample( const T& t, int sortOrder ); | 69 | virtual List queryByExample( const T& t, int sortOrder ); |
70 | 70 | ||
71 | /** | 71 | /** |
72 | * find the OPimRecord uid | 72 | * find the OPimRecord uid |
73 | */ | 73 | */ |
74 | virtual T find( int uid ); | 74 | virtual T find( int uid )const; |
75 | 75 | ||
76 | /* invalidate cache here */ | 76 | /* invalidate cache here */ |
@@ -79,5 +79,5 @@ public: | |||
79 | */ | 79 | */ |
80 | virtual void clear() ; | 80 | virtual void clear() ; |
81 | 81 | ||
82 | /** | 82 | /** |
83 | * add T to the backend | 83 | * add T to the backend |
@@ -90,10 +90,10 @@ public: | |||
90 | */ | 90 | */ |
91 | virtual bool remove( const T& t ); | 91 | virtual bool remove( const T& t ); |
92 | 92 | ||
93 | /** | 93 | /** |
94 | * remove the OPimRecord with uid | 94 | * remove the OPimRecord with uid |
95 | */ | 95 | */ |
96 | virtual bool remove( int uid ); | 96 | virtual bool remove( int uid ); |
97 | 97 | ||
98 | /** | 98 | /** |
99 | * replace T from backend | 99 | * replace T from backend |
@@ -105,5 +105,6 @@ protected: | |||
105 | */ | 105 | */ |
106 | void invalidateCache(); | 106 | void invalidateCache(); |
107 | 107 | ||
108 | void setBackEnd( BackEnd* end ); | ||
108 | /** | 109 | /** |
109 | * returns the backend | 110 | * returns the backend |
@@ -126,14 +127,14 @@ OPimAccessTemplate<T>::~OPimAccessTemplate() { | |||
126 | } | 127 | } |
127 | template <class T> | 128 | template <class T> |
128 | void OPimAccessTemplate<T>::load() { | 129 | bool OPimAccessTemplate<T>::load() { |
129 | m_backEnd->load(); | 130 | return m_backEnd->load(); |
130 | } | 131 | } |
131 | template <class T> | 132 | template <class T> |
132 | void OPimAccessTemplate<T>::reload() { | 133 | bool OPimAccessTemplate<T>::reload() { |
133 | m_backEnd->reload(); | 134 | return m_backEnd->reload(); |
134 | } | 135 | } |
135 | template <class T> | 136 | template <class T> |
136 | void OPimAccessTemplate<T>::save() { | 137 | bool OPimAccessTemplate<T>::save() { |
137 | m_backEnd->save(); | 138 | return m_backEnd->save(); |
138 | } | 139 | } |
139 | template <class T> | 140 | template <class T> |
@@ -152,5 +153,5 @@ OPimAccessTemplate<T>::queryByExample( const T& t, int sortOrder ) { | |||
152 | } | 153 | } |
153 | template <class T> | 154 | template <class T> |
154 | T OPimAccessTemplate<T>::find( int uid ) { | 155 | T OPimAccessTemplate<T>::find( int uid ) const{ |
155 | T t = m_backEnd->find( uid ); | 156 | T t = m_backEnd->find( uid ); |
156 | return t; | 157 | return t; |
@@ -189,3 +190,7 @@ bool OPimAccessTemplate<T>::wasChangedExternally()const { | |||
189 | return false; | 190 | return false; |
190 | } | 191 | } |
192 | template <class T> | ||
193 | void OPimAccessTemplate<T>::setBackEnd( BackEnd* end ) { | ||
194 | m_backEnd = end; | ||
195 | } | ||
191 | #endif | 196 | #endif |