Diffstat (limited to 'libopie2/opiepim/core/opimaccesstemplate.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimaccesstemplate.h | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/libopie2/opiepim/core/opimaccesstemplate.h b/libopie2/opiepim/core/opimaccesstemplate.h index 3e1f393..50cb1e4 100644 --- a/libopie2/opiepim/core/opimaccesstemplate.h +++ b/libopie2/opiepim/core/opimaccesstemplate.h | |||
@@ -34,35 +34,41 @@ public: | |||
34 | 34 | ||
35 | /** | 35 | /** |
36 | * load from the backend | 36 | * load from the backend |
37 | */ | 37 | */ |
38 | virtual bool load(); | 38 | virtual bool load(); |
39 | 39 | ||
40 | /** | 40 | /** Reload database. |
41 | * reload from the backend | 41 | * You should execute this function if the external database |
42 | * was changed. | ||
43 | * This function will load the external database and afterwards | ||
44 | * rejoin the local changes. Therefore the local database will be set consistent. | ||
42 | */ | 45 | */ |
43 | virtual bool reload(); | 46 | virtual bool reload(); |
44 | 47 | ||
45 | /** | 48 | /** Save contacts database. |
46 | * save to the backend | 49 | * Save is more a "commit". After calling this function, all changes are public available. |
50 | * @return true if successful | ||
47 | */ | 51 | */ |
48 | virtual bool save(); | 52 | virtual bool save(); |
49 | 53 | ||
50 | /** | 54 | /** |
51 | * if the resource was changed externally | 55 | * if the resource was changed externally |
56 | * You should use the signal handling instead of polling possible changes ! | ||
57 | * zecke: Do you implement a signal for otodoaccess ? | ||
52 | */ | 58 | */ |
53 | bool wasChangedExternally()const; | 59 | bool wasChangedExternally()const; |
54 | 60 | ||
55 | /** | 61 | /** |
56 | * return a List of records | 62 | * return a List of records |
57 | * you can iterate over them | 63 | * you can iterate over them |
58 | */ | 64 | */ |
59 | virtual List allRecords()const; | 65 | virtual List allRecords()const; |
60 | 66 | ||
61 | /** | 67 | /** |
62 | * queryByExample) | 68 | * queryByExample. |
63 | * @see otodoaccess, ocontactaccess | 69 | * @see otodoaccess, ocontactaccess |
64 | */ | 70 | */ |
65 | virtual List queryByExample( const T& t, int querySettings ); | 71 | virtual List queryByExample( const T& t, int querySettings ); |
66 | 72 | ||
67 | /** | 73 | /** |
68 | * find the OPimRecord uid | 74 | * find the OPimRecord uid |
@@ -80,28 +86,36 @@ public: | |||
80 | * clears the backend and invalidates the backend | 86 | * clears the backend and invalidates the backend |
81 | */ | 87 | */ |
82 | virtual void clear() ; | 88 | virtual void clear() ; |
83 | 89 | ||
84 | /** | 90 | /** |
85 | * add T to the backend | 91 | * add T to the backend |
92 | * @param t The item to add. | ||
93 | * @return <i>true</i> if added successfully. | ||
86 | */ | 94 | */ |
87 | virtual bool add( const T& t ) ; | 95 | virtual bool add( const T& t ) ; |
88 | 96 | ||
89 | /* only the uid matters */ | 97 | /* only the uid matters */ |
90 | /** | 98 | /** |
91 | * remove T from the backend | 99 | * remove T from the backend |
100 | * @param t The item to remove | ||
101 | * @return <i>true</i> if successful. | ||
92 | */ | 102 | */ |
93 | virtual bool remove( const T& t ); | 103 | virtual bool remove( const T& t ); |
94 | 104 | ||
95 | /** | 105 | /** |
96 | * remove the OPimRecord with uid | 106 | * remove the OPimRecord with uid |
107 | * @param uid The ID of the item to remove | ||
108 | * @return <i>true</i> if successful. | ||
97 | */ | 109 | */ |
98 | virtual bool remove( int uid ); | 110 | virtual bool remove( int uid ); |
99 | 111 | ||
100 | /** | 112 | /** |
101 | * replace T from backend | 113 | * replace T from backend |
114 | * @param t The item to replace | ||
115 | * @return <i>true</i> if successful. | ||
102 | */ | 116 | */ |
103 | virtual bool replace( const T& t) ; | 117 | virtual bool replace( const T& t) ; |
104 | 118 | ||
105 | /** | 119 | /** |
106 | * @internal | 120 | * @internal |
107 | */ | 121 | */ |
@@ -139,13 +153,14 @@ template <class T> | |||
139 | bool OPimAccessTemplate<T>::load() { | 153 | bool OPimAccessTemplate<T>::load() { |
140 | invalidateCache(); | 154 | invalidateCache(); |
141 | return m_backEnd->load(); | 155 | return m_backEnd->load(); |
142 | } | 156 | } |
143 | template <class T> | 157 | template <class T> |
144 | bool OPimAccessTemplate<T>::reload() { | 158 | bool OPimAccessTemplate<T>::reload() { |
145 | return m_backEnd->reload(); | 159 | invalidateCache(); // zecke: I think this should be added (se) |
160 | return m_backEnd->reload(); | ||
146 | } | 161 | } |
147 | template <class T> | 162 | template <class T> |
148 | bool OPimAccessTemplate<T>::save() { | 163 | bool OPimAccessTemplate<T>::save() { |
149 | return m_backEnd->save(); | 164 | return m_backEnd->save(); |
150 | } | 165 | } |
151 | template <class T> | 166 | template <class T> |