summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core
authortille <tille>2003-05-08 13:55:09 (UTC)
committer tille <tille>2003-05-08 13:55:09 (UTC)
commit0cb4111d34d9fe96731f48983e1ff2e67262db02 (patch) (side-by-side diff)
treece6ec869ae7753ab0261e7ad075a10ad8b0a404b /libopie2/opiepim/core
parent78c60031b506b85dc20bd555d83486aeb831bf38 (diff)
downloadopie-0cb4111d34d9fe96731f48983e1ff2e67262db02.zip
opie-0cb4111d34d9fe96731f48983e1ff2e67262db02.tar.gz
opie-0cb4111d34d9fe96731f48983e1ff2e67262db02.tar.bz2
search stuff
and match, toRichText & toShortText in oevent
Diffstat (limited to 'libopie2/opiepim/core') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/ocontactaccess.cpp13
-rw-r--r--libopie2/opiepim/core/ocontactaccess.h6
-rw-r--r--libopie2/opiepim/core/opimaccesstemplate.h12
-rw-r--r--libopie2/opiepim/core/opimrecord.h6
4 files changed, 28 insertions, 9 deletions
diff --git a/libopie2/opiepim/core/ocontactaccess.cpp b/libopie2/opiepim/core/ocontactaccess.cpp
index 9c9338e..2e3ec1f 100644
--- a/libopie2/opiepim/core/ocontactaccess.cpp
+++ b/libopie2/opiepim/core/ocontactaccess.cpp
@@ -21,6 +21,10 @@
* =====================================================================
* History:
* $Log$
+ * Revision 1.8 2003/05/08 13:55:09 tille
+ * search stuff
+ * and match, toRichText & toShortText in oevent
+ *
* Revision 1.7 2002/11/13 14:14:51 eilers
* Added sorted for Contacts..
*
@@ -73,7 +77,7 @@ OContactAccess::OContactAccess ( const QString appname, const QString ,
OContactAccessBackend* end, bool autosync ):
OPimAccessTemplate<OContact>( end )
{
- /* take care of the backend. If there is no one defined, we
+ /* take care of the backend. If there is no one defined, we
* will use the XML-Backend as default (until we have a cute SQL-Backend..).
*/
if( end == 0 ) {
@@ -83,7 +87,7 @@ OContactAccess::OContactAccess ( const QString appname, const QString ,
// Set backend locally and in template
m_backEnd = end;
OPimAccessTemplate<OContact>::setBackEnd (end);
-
+
/* Connect signal of external db change to function */
QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this );
@@ -126,11 +130,6 @@ bool OContactAccess::save ()
return true;
}
-ORecordList<OContact> OContactAccess::matchRegexp( const QRegExp &r ) const{
- QArray<int> matchingContacts = m_backEnd -> matchRegexp( r );
- return ( ORecordList<OContact>(matchingContacts, this) );
-}
-
const uint OContactAccess::querySettings()
{
return ( m_backEnd->querySettings() );
diff --git a/libopie2/opiepim/core/ocontactaccess.h b/libopie2/opiepim/core/ocontactaccess.h
index d7ceaf2..e90db32 100644
--- a/libopie2/opiepim/core/ocontactaccess.h
+++ b/libopie2/opiepim/core/ocontactaccess.h
@@ -17,6 +17,10 @@
* =====================================================================
* History:
* $Log$
+ * Revision 1.8 2003/05/08 13:55:09 tille
+ * search stuff
+ * and match, toRichText & toShortText in oevent
+ *
* Revision 1.7 2003/04/13 18:07:10 zecke
* More API doc
* QString -> const QString&
@@ -110,8 +114,6 @@ class OContactAccess: public QObject, public OPimAccessTemplate<OContact>
};
- ORecordList<OContact> matchRegexp( const QRegExp &r )const;
-
/** Return all Contacts in a sorted manner.
* @param ascending true: Sorted in acending order.
* @param sortOrder Currently not implemented. Just defined to stay compatible to otodoaccess
diff --git a/libopie2/opiepim/core/opimaccesstemplate.h b/libopie2/opiepim/core/opimaccesstemplate.h
index 6a3a0db..8ff205c 100644
--- a/libopie2/opiepim/core/opimaccesstemplate.h
+++ b/libopie2/opiepim/core/opimaccesstemplate.h
@@ -69,6 +69,12 @@ public:
* you can iterate over them
*/
virtual List allRecords()const;
+
+ /**
+ * return a List of records
+ * that match the regex
+ */
+ virtual List matchRegexp( const QRegExp &r ) const;
/**
* queryByExample.
@@ -181,6 +187,12 @@ typename OPimAccessTemplate<T>::List OPimAccessTemplate<T>::allRecords()const {
return lis;
}
template <class T>
+typename OPimAccessTemplate<T>::List OPimAccessTemplate<T>::matchRegexp( const QRegExp &r )const {
+ QArray<int> ints = m_backEnd->matchRegexp( r );
+ List lis(ints, this );
+ return lis;
+}
+template <class T>
QArray<int> OPimAccessTemplate<T>::records()const {
return m_backEnd->allRecords();
}
diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h
index c7f9460..de2d9f4 100644
--- a/libopie2/opiepim/core/opimrecord.h
+++ b/libopie2/opiepim/core/opimrecord.h
@@ -73,6 +73,12 @@ public:
virtual QString type()const = 0;
/**
+ * matches the Records the regular expression?
+ */
+ virtual bool match( const QString &regexp ) const {return match(QRegExp(regexp));};
+ virtual bool match( const QRegExp &regexp ) const = 0;
+
+ /**
* converts the internal structure to a map
*/
virtual QMap<int, QString> toMap()const = 0;