summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim/backend') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend.h7
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_xml.h20
2 files changed, 27 insertions, 0 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend.h b/libopie2/opiepim/backend/ocontactaccessbackend.h
index a651477..c898f61 100644
--- a/libopie2/opiepim/backend/ocontactaccessbackend.h
+++ b/libopie2/opiepim/backend/ocontactaccessbackend.h
@@ -20,4 +20,7 @@
* History:
* $Log$
+ * Revision 1.3 2002/11/01 15:10:42 eilers
+ * Added regExp-search in database for all fields in a contact.
+ *
* Revision 1.2 2002/10/07 17:34:24 eilers
* added OBackendFactory for advanced backend access
@@ -39,4 +42,6 @@
#include "opimaccessbackend.h"
+#include "qregexp.h"
+
class OContactAccessBackend: public OPimAccessBackend<OContact> {
public:
@@ -59,4 +64,6 @@ class OContactAccessBackend: public OPimAccessBackend<OContact> {
virtual bool wasChangedExternally() = 0;
+ virtual QArray<int> matchRegexp( const QRegExp &r ) const = 0;
+
/** Return all possible settings.
* @return All settings provided by the current backend
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.h b/libopie2/opiepim/backend/ocontactaccessbackend_xml.h
index 12a75ba..f7e8207 100644
--- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.h
+++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.h
@@ -18,4 +18,7 @@
* History:
* $Log$
+ * Revision 1.5 2002/11/01 15:10:42 eilers
+ * Added regExp-search in database for all fields in a contact.
+ *
* Revision 1.4 2002/10/16 10:52:40 eilers
* Added some docu to the interface and now using the cache infrastucture by zecke.. :)
@@ -255,4 +258,21 @@ class OContactAccessBackend_XML : public OContactAccessBackend {
return m_currentQuery;
}
+
+ QArray<int> matchRegexp( const QRegExp &r ) const{
+ QArray<int> m_currentQuery( m_contactList.count() );
+ QValueListConstIterator<OContact> it;
+ uint arraycounter = 0;
+
+ for( it = m_contactList.begin(); it != m_contactList.end(); ++it ){
+ if ( (*it).match( r ) ){
+ m_currentQuery[arraycounter++] = (*it).uid();
+ }
+
+ }
+ // Shrink to fit..
+ m_currentQuery.resize(arraycounter);
+
+ return m_currentQuery;
+ }
const uint querySettings()