summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/opimaccessbackend.h
authoreilers <eilers>2004-12-20 14:14:07 (UTC)
committer eilers <eilers>2004-12-20 14:14:07 (UTC)
commit18e47153532d016d878f47e0ce11cb1a9716218e (patch) (side-by-side diff)
tree52eb6c25258fda0b2f295a29809c4603f5e17b0b /libopie2/opiepim/backend/opimaccessbackend.h
parent876e48baa20213d8265041cfac3034fe92cb0590 (diff)
downloadopie-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.h40
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:
+ //@{
+ // FIXME: Uncommented some of the abstract functions below. This should be removed as they are implemented in
+ // all typespecifc backenends (eilers)
+ /**
+ * Return all possible settings for queryByExample()
+ * @return All settings provided by the current backend
+ * (i.e.: query_WildCards & query_IgnoreCase)
+ * See implementation in the specific backends for contacts, todo and dates.
+ */
+ virtual const uint querySettings() const { return 0; } /* FIXME: Make Abstrakt !! = 0; */
+
+ /**
+ * Check whether settings are correct for queryByExample()
+ * See implementation in the specific backends for OPimContactAccess, OPimTodoAccess and ODateBookAccess.
+ * @return <i>true</i> if the given settings are correct and possible.
+ */
+ virtual bool hasQuerySettings (uint querySettings) const { return false; } /* FIXME: Make Abstrakt !! = 0; */
+ //@}
+
@@ -72,5 +91,7 @@ public:
virtual UIDArray matchRegexp(const QRegExp &r) const;
- virtual UIDArray queryByExample( const T& t, int settings, const QDateTime& d = QDateTime() )const = 0;
- virtual UIDArray queryByExample( const OPimRecord* rec, int, const QDateTime& d = QDateTime() )const;
- virtual UIDArray sorted( const UIDArray&, bool asc, int sortOrder, int sortFilter, const QArray<int>& cats )const;
+ virtual UIDArray queryByExample( const UIDArray&, const T& t,
+ int settings, const QDateTime& d = QDateTime() )const { return UIDArray(); } /* FIXME: Make Abstrakt !! = 0; */
+ virtual UIDArray queryByExample( const T& t, int settings, const QDateTime& d = QDateTime() )const;
+ virtual UIDArray queryByExample( const OPimRecord* rec, int settings, const QDateTime& d = QDateTime() )const;
+ virtual UIDArray sorted( const UIDArray&, bool asc, int sortOrder, int sortFilter, const QArray<int>& cats )const = 0;
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 {
template <class T>
+UIDArray OPimAccessBackend<T>::queryByExample( const T& rec, int settings,
+ const QDateTime& datetime )const {
+
+ return queryByExample( allRecords(), rec, settings, datetime );
+}
+
+template <class T>
UIDArray OPimAccessBackend<T>::queryByExample( const OPimRecord* rec, int settings,
@@ -163,8 +191,2 @@ UIDArray OPimAccessBackend<T>::queryByExample( const OPimRecord* rec, int settin
template <class T>
-UIDArray OPimAccessBackend<T>::sorted( const UIDArray& ids, bool,
- int, int, const QArray<int>& ) const {
- return ids;
-}
-
-template <class T>
UIDArray OPimAccessBackend<T>::sorted( bool asc, int order, int filter,