summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core
authoreilers <eilers>2002-11-13 14:14:51 (UTC)
committer eilers <eilers>2002-11-13 14:14:51 (UTC)
commit2255284b2e80bdc2881ab9106e9afa614a08c140 (patch) (side-by-side diff)
tree89e53028d842061371e6414ee037f96fa0fbef5e /libopie2/opiepim/core
parenteaecbed44924ece119c5b41db2828b4554f263d2 (diff)
downloadopie-2255284b2e80bdc2881ab9106e9afa614a08c140.zip
opie-2255284b2e80bdc2881ab9106e9afa614a08c140.tar.gz
opie-2255284b2e80bdc2881ab9106e9afa614a08c140.tar.bz2
Added sorted for Contacts..
Diffstat (limited to 'libopie2/opiepim/core') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/ocontactaccess.cpp8
-rw-r--r--libopie2/opiepim/core/ocontactaccess.h11
2 files changed, 19 insertions, 0 deletions
diff --git a/libopie2/opiepim/core/ocontactaccess.cpp b/libopie2/opiepim/core/ocontactaccess.cpp
index f868b53..9c9338e 100644
--- a/libopie2/opiepim/core/ocontactaccess.cpp
+++ b/libopie2/opiepim/core/ocontactaccess.cpp
@@ -12,24 +12,27 @@
* Info: This class could just work with a change in the header-file
* of the Contact class ! Therefore our libopie only compiles
* with our version of libqpe
* =====================================================================
* ToDo: XML-Backend: Automatic reload if something was changed...
*
*
* =====================================================================
* Version: $Id$
* =====================================================================
* History:
* $Log$
+ * Revision 1.7 2002/11/13 14:14:51 eilers
+ * Added sorted for Contacts..
+ *
* Revision 1.6 2002/11/01 15:10:42 eilers
* Added regExp-search in database for all fields in a contact.
*
* Revision 1.5 2002/10/16 10:52:40 eilers
* Added some docu to the interface and now using the cache infrastucture by zecke.. :)
*
* Revision 1.4 2002/10/14 16:21:54 eilers
* Some minor interface updates
*
* Revision 1.3 2002/10/07 17:34:24 eilers
* added OBackendFactory for advanced backend access
*
@@ -128,24 +131,29 @@ ORecordList<OContact> OContactAccess::matchRegexp( const QRegExp &r ) const{
return ( ORecordList<OContact>(matchingContacts, this) );
}
const uint OContactAccess::querySettings()
{
return ( m_backEnd->querySettings() );
}
bool OContactAccess::hasQuerySettings ( int querySettings ) const
{
return ( m_backEnd->hasQuerySettings ( querySettings ) );
}
+ORecordList<OContact> OContactAccess::sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const
+{
+ QArray<int> matchingContacts = m_backEnd -> sorted( ascending, sortOrder, sortFilter, cat );
+ return ( ORecordList<OContact>(matchingContacts, this) );
+}
bool OContactAccess::wasChangedExternally()const
{
return ( m_backEnd->wasChangedExternally() );
}
void OContactAccess::copMessage( const QCString &msg, const QByteArray & )
{
if ( msg == "addressbookUpdated()" ){
qWarning ("OContactAccess: Received addressbokUpdated()");
diff --git a/libopie2/opiepim/core/ocontactaccess.h b/libopie2/opiepim/core/ocontactaccess.h
index b4921d5..961968f 100644
--- a/libopie2/opiepim/core/ocontactaccess.h
+++ b/libopie2/opiepim/core/ocontactaccess.h
@@ -8,24 +8,27 @@
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation;
* either version 2 of the License, or (at your option) any later
* version.
* =====================================================================
* ToDo: Define enum for query settings
* =====================================================================
* Version: $Id$
* =====================================================================
* History:
* $Log$
+ * Revision 1.5 2002/11/13 14:14:51 eilers
+ * Added sorted for Contacts..
+ *
* Revision 1.4 2002/11/01 15:10:42 eilers
* Added regExp-search in database for all fields in a contact.
*
* Revision 1.3 2002/10/16 10:52:40 eilers
* Added some docu to the interface and now using the cache infrastucture by zecke.. :)
*
* Revision 1.2 2002/10/14 16:21:54 eilers
* Some minor interface updates
*
* Revision 1.1 2002/09/27 17:11:44 eilers
* Added API for accessing the Contact-Database ! It is compiling, but
* please do not expect that anything is working !
@@ -82,24 +85,32 @@ class OContactAccess: public QObject, public OPimAccessTemplate<OContact>
*/
enum QuerySettings {
WildCards = 0x0001,
IgnoreCase = 0x0002,
RegExp = 0x0004,
ExactMatch = 0x0008,
MatchOne = 0x0010 // Only one Entry must match
};
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
+ * @param sortFilter Currently not implemented. Just defined to stay compatible to otodoaccess
+ * @param cat Currently not implemented. Just defined to stay compatible to otodoaccess
+ */
+ List sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const;
+
/** Return all possible settings.
* @return All settings provided by the current backend
* (i.e.: query_WildCards & query_IgnoreCase)
*/
const uint querySettings();
/** Check whether settings are correct.
* @return <i>true</i> if the given settings are correct and possible.
*/
bool hasQuerySettings ( int querySettings ) const;
/**