From 0cb4111d34d9fe96731f48983e1ff2e67262db02 Mon Sep 17 00:00:00 2001 From: tille Date: Thu, 08 May 2003 13:55:09 +0000 Subject: search stuff and match, toRichText & toShortText in oevent --- (limited to 'libopie2/opiepim/core') 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( 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::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 OContactAccess::matchRegexp( const QRegExp &r ) const{ - QArray matchingContacts = m_backEnd -> matchRegexp( r ); - return ( ORecordList(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 }; - ORecordList 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::List OPimAccessTemplate::allRecords()const { return lis; } template +typename OPimAccessTemplate::List OPimAccessTemplate::matchRegexp( const QRegExp &r )const { + QArray ints = m_backEnd->matchRegexp( r ); + List lis(ints, this ); + return lis; +} +template QArray OPimAccessTemplate::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 ®exp ) const {return match(QRegExp(regexp));}; + virtual bool match( const QRegExp ®exp ) const = 0; + + /** * converts the internal structure to a map */ virtual QMap toMap()const = 0; -- cgit v0.9.0.2