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) (unidiff)
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 @@
12 * Info: This class could just work with a change in the header-file 12 * Info: This class could just work with a change in the header-file
13 * of the Contact class ! Therefore our libopie only compiles 13 * of the Contact class ! Therefore our libopie only compiles
14 * with our version of libqpe 14 * with our version of libqpe
15 * ===================================================================== 15 * =====================================================================
16 * ToDo: XML-Backend: Automatic reload if something was changed... 16 * ToDo: XML-Backend: Automatic reload if something was changed...
17 * 17 *
18 * 18 *
19 * ===================================================================== 19 * =====================================================================
20 * Version: $Id$ 20 * Version: $Id$
21 * ===================================================================== 21 * =====================================================================
22 * History: 22 * History:
23 * $Log$ 23 * $Log$
24 * Revision 1.7 2002/11/13 14:14:51 eilers
25 * Added sorted for Contacts..
26 *
24 * Revision 1.6 2002/11/01 15:10:42 eilers 27 * Revision 1.6 2002/11/01 15:10:42 eilers
25 * Added regExp-search in database for all fields in a contact. 28 * Added regExp-search in database for all fields in a contact.
26 * 29 *
27 * Revision 1.5 2002/10/16 10:52:40 eilers 30 * Revision 1.5 2002/10/16 10:52:40 eilers
28 * Added some docu to the interface and now using the cache infrastucture by zecke.. :) 31 * Added some docu to the interface and now using the cache infrastucture by zecke.. :)
29 * 32 *
30 * Revision 1.4 2002/10/14 16:21:54 eilers 33 * Revision 1.4 2002/10/14 16:21:54 eilers
31 * Some minor interface updates 34 * Some minor interface updates
32 * 35 *
33 * Revision 1.3 2002/10/07 17:34:24 eilers 36 * Revision 1.3 2002/10/07 17:34:24 eilers
34 * added OBackendFactory for advanced backend access 37 * added OBackendFactory for advanced backend access
35 * 38 *
@@ -128,24 +131,29 @@ ORecordList<OContact> OContactAccess::matchRegexp( const QRegExp &r ) const{
128 return ( ORecordList<OContact>(matchingContacts, this) ); 131 return ( ORecordList<OContact>(matchingContacts, this) );
129} 132}
130 133
131const uint OContactAccess::querySettings() 134const uint OContactAccess::querySettings()
132{ 135{
133 return ( m_backEnd->querySettings() ); 136 return ( m_backEnd->querySettings() );
134} 137}
135 138
136bool OContactAccess::hasQuerySettings ( int querySettings ) const 139bool OContactAccess::hasQuerySettings ( int querySettings ) const
137{ 140{
138 return ( m_backEnd->hasQuerySettings ( querySettings ) ); 141 return ( m_backEnd->hasQuerySettings ( querySettings ) );
139} 142}
143ORecordList<OContact> OContactAccess::sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const
144{
145 QArray<int> matchingContacts = m_backEnd -> sorted( ascending, sortOrder, sortFilter, cat );
146 return ( ORecordList<OContact>(matchingContacts, this) );
147}
140 148
141 149
142bool OContactAccess::wasChangedExternally()const 150bool OContactAccess::wasChangedExternally()const
143{ 151{
144 return ( m_backEnd->wasChangedExternally() ); 152 return ( m_backEnd->wasChangedExternally() );
145} 153}
146 154
147 155
148void OContactAccess::copMessage( const QCString &msg, const QByteArray & ) 156void OContactAccess::copMessage( const QCString &msg, const QByteArray & )
149{ 157{
150 if ( msg == "addressbookUpdated()" ){ 158 if ( msg == "addressbookUpdated()" ){
151 qWarning ("OContactAccess: Received addressbokUpdated()"); 159 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 @@
8 *This program is free software; you can redistribute it and/or 8 *This program is free software; you can redistribute it and/or
9 *modify it under the terms of the GNU Library General Public 9 *modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; 10 * License as published by the Free Software Foundation;
11 * either version 2 of the License, or (at your option) any later 11 * either version 2 of the License, or (at your option) any later
12 * version. 12 * version.
13 * ===================================================================== 13 * =====================================================================
14 * ToDo: Define enum for query settings 14 * ToDo: Define enum for query settings
15 * ===================================================================== 15 * =====================================================================
16 * Version: $Id$ 16 * Version: $Id$
17 * ===================================================================== 17 * =====================================================================
18 * History: 18 * History:
19 * $Log$ 19 * $Log$
20 * Revision 1.5 2002/11/13 14:14:51 eilers
21 * Added sorted for Contacts..
22 *
20 * Revision 1.4 2002/11/01 15:10:42 eilers 23 * Revision 1.4 2002/11/01 15:10:42 eilers
21 * Added regExp-search in database for all fields in a contact. 24 * Added regExp-search in database for all fields in a contact.
22 * 25 *
23 * Revision 1.3 2002/10/16 10:52:40 eilers 26 * Revision 1.3 2002/10/16 10:52:40 eilers
24 * Added some docu to the interface and now using the cache infrastucture by zecke.. :) 27 * Added some docu to the interface and now using the cache infrastucture by zecke.. :)
25 * 28 *
26 * Revision 1.2 2002/10/14 16:21:54 eilers 29 * Revision 1.2 2002/10/14 16:21:54 eilers
27 * Some minor interface updates 30 * Some minor interface updates
28 * 31 *
29 * Revision 1.1 2002/09/27 17:11:44 eilers 32 * Revision 1.1 2002/09/27 17:11:44 eilers
30 * Added API for accessing the Contact-Database ! It is compiling, but 33 * Added API for accessing the Contact-Database ! It is compiling, but
31 * please do not expect that anything is working ! 34 * please do not expect that anything is working !
@@ -82,24 +85,32 @@ class OContactAccess: public QObject, public OPimAccessTemplate<OContact>
82 */ 85 */
83 enum QuerySettings { 86 enum QuerySettings {
84 WildCards = 0x0001, 87 WildCards = 0x0001,
85 IgnoreCase = 0x0002, 88 IgnoreCase = 0x0002,
86 RegExp = 0x0004, 89 RegExp = 0x0004,
87 ExactMatch = 0x0008, 90 ExactMatch = 0x0008,
88 MatchOne = 0x0010 // Only one Entry must match 91 MatchOne = 0x0010 // Only one Entry must match
89 }; 92 };
90 93
91 94
92 ORecordList<OContact> matchRegexp( const QRegExp &r )const; 95 ORecordList<OContact> matchRegexp( const QRegExp &r )const;
93 96
97 /** Return all Contacts in a sorted manner.
98 * @param ascending true: Sorted in acending order.
99 * @param sortOrder Currently not implemented. Just defined to stay compatible to otodoaccess
100 * @param sortFilter Currently not implemented. Just defined to stay compatible to otodoaccess
101 * @param cat Currently not implemented. Just defined to stay compatible to otodoaccess
102 */
103 List sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const;
104
94 /** Return all possible settings. 105 /** Return all possible settings.
95 * @return All settings provided by the current backend 106 * @return All settings provided by the current backend
96 * (i.e.: query_WildCards & query_IgnoreCase) 107 * (i.e.: query_WildCards & query_IgnoreCase)
97 */ 108 */
98 const uint querySettings(); 109 const uint querySettings();
99 110
100 /** Check whether settings are correct. 111 /** Check whether settings are correct.
101 * @return <i>true</i> if the given settings are correct and possible. 112 * @return <i>true</i> if the given settings are correct and possible.
102 */ 113 */
103 bool hasQuerySettings ( int querySettings ) const; 114 bool hasQuerySettings ( int querySettings ) const;
104 115
105 /** 116 /**