author | eilers <eilers> | 2004-12-20 14:14:07 (UTC) |
---|---|---|
committer | eilers <eilers> | 2004-12-20 14:14:07 (UTC) |
commit | 18e47153532d016d878f47e0ce11cb1a9716218e (patch) (unidiff) | |
tree | 52eb6c25258fda0b2f295a29809c4603f5e17b0b /libopie2/opiepim/backend/opimaccessbackend.h | |
parent | 876e48baa20213d8265041cfac3034fe92cb0590 (diff) | |
download | opie-18e47153532d016d878f47e0ce11cb1a9716218e.zip opie-18e47153532d016d878f47e0ce11cb1a9716218e.tar.gz opie-18e47153532d016d878f47e0ce11cb1a9716218e.tar.bz2 |
Recovery of the following Changes:
* Implement fast and full featured version of sorted() for addressbook
* Implement generic queryByExample for all Addressboook backends. It allows incremental search.
* Update of API Documentation
Diffstat (limited to 'libopie2/opiepim/backend/opimaccessbackend.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/opimaccessbackend.h | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/libopie2/opiepim/backend/opimaccessbackend.h b/libopie2/opiepim/backend/opimaccessbackend.h index 0d112c9..7321758 100644 --- a/libopie2/opiepim/backend/opimaccessbackend.h +++ b/libopie2/opiepim/backend/opimaccessbackend.h | |||
@@ -68,2 +68,21 @@ public: | |||
68 | 68 | ||
69 | //@{ | ||
70 | // FIXME: Uncommented some of the abstract functions below. This should be removed as they are implemented in | ||
71 | // all typespecifc backenends (eilers) | ||
72 | /** | ||
73 | * Return all possible settings for queryByExample() | ||
74 | * @return All settings provided by the current backend | ||
75 | * (i.e.: query_WildCards & query_IgnoreCase) | ||
76 | * See implementation in the specific backends for contacts, todo and dates. | ||
77 | */ | ||
78 | virtual const uint querySettings() const { return 0; } /* FIXME: Make Abstrakt !! = 0; */ | ||
79 | |||
80 | /** | ||
81 | * Check whether settings are correct for queryByExample() | ||
82 | * See implementation in the specific backends for OPimContactAccess, OPimTodoAccess and ODateBookAccess. | ||
83 | * @return <i>true</i> if the given settings are correct and possible. | ||
84 | */ | ||
85 | virtual bool hasQuerySettings (uint querySettings) const { return false; } /* FIXME: Make Abstrakt !! = 0; */ | ||
86 | //@} | ||
87 | |||
69 | 88 | ||
@@ -72,5 +91,7 @@ public: | |||
72 | virtual UIDArray matchRegexp(const QRegExp &r) const; | 91 | virtual UIDArray matchRegexp(const QRegExp &r) const; |
73 | virtual UIDArray queryByExample( const T& t, int settings, const QDateTime& d = QDateTime() )const = 0; | 92 | virtual UIDArray queryByExample( const UIDArray&, const T& t, |
74 | virtual UIDArray queryByExample( const OPimRecord* rec, int, const QDateTime& d = QDateTime() )const; | 93 | int settings, const QDateTime& d = QDateTime() )const { return UIDArray(); } /* FIXME: Make Abstrakt !! = 0; */ |
75 | virtual UIDArray sorted( const UIDArray&, bool asc, int sortOrder, int sortFilter, const QArray<int>& cats )const; | 94 | virtual UIDArray queryByExample( const T& t, int settings, const QDateTime& d = QDateTime() )const; |
95 | virtual UIDArray queryByExample( const OPimRecord* rec, int settings, const QDateTime& d = QDateTime() )const; | ||
96 | virtual UIDArray sorted( const UIDArray&, bool asc, int sortOrder, int sortFilter, const QArray<int>& cats )const = 0; | ||
76 | virtual UIDArray sorted( bool asc, int sortOrder, int sortFilter, const QArray<int>& cats )const; | 97 | virtual UIDArray sorted( bool asc, int sortOrder, int sortFilter, const QArray<int>& cats )const; |
@@ -152,2 +173,9 @@ UIDArray OPimAccessBackend<T>::matchRegexp( const QRegExp& reg )const { | |||
152 | template <class T> | 173 | template <class T> |
174 | UIDArray OPimAccessBackend<T>::queryByExample( const T& rec, int settings, | ||
175 | const QDateTime& datetime )const { | ||
176 | |||
177 | return queryByExample( allRecords(), rec, settings, datetime ); | ||
178 | } | ||
179 | |||
180 | template <class T> | ||
153 | UIDArray OPimAccessBackend<T>::queryByExample( const OPimRecord* rec, int settings, | 181 | UIDArray OPimAccessBackend<T>::queryByExample( const OPimRecord* rec, int settings, |
@@ -163,8 +191,2 @@ UIDArray OPimAccessBackend<T>::queryByExample( const OPimRecord* rec, int settin | |||
163 | template <class T> | 191 | template <class T> |
164 | UIDArray OPimAccessBackend<T>::sorted( const UIDArray& ids, bool, | ||
165 | int, int, const QArray<int>& ) const { | ||
166 | return ids; | ||
167 | } | ||
168 | |||
169 | template <class T> | ||
170 | UIDArray OPimAccessBackend<T>::sorted( bool asc, int order, int filter, | 192 | UIDArray OPimAccessBackend<T>::sorted( bool asc, int order, int filter, |