summaryrefslogtreecommitdiff
path: root/libopie
authoreilers <eilers>2002-10-14 16:21:54 (UTC)
committer eilers <eilers>2002-10-14 16:21:54 (UTC)
commitf48ddfb53e49550f9fe8e9502f2a44aeb8b359cc (patch) (unidiff)
tree7972f3fc9a1d61e22fe57ff0fa96fd9a0badb55d /libopie
parentda3868438e739310862bf65b0d0c8ffa864392e8 (diff)
downloadopie-f48ddfb53e49550f9fe8e9502f2a44aeb8b359cc.zip
opie-f48ddfb53e49550f9fe8e9502f2a44aeb8b359cc.tar.gz
opie-f48ddfb53e49550f9fe8e9502f2a44aeb8b359cc.tar.bz2
Some minor interface updates
Diffstat (limited to 'libopie') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/DESIGN6
-rw-r--r--libopie/pim/ocontactaccess.cpp4
-rw-r--r--libopie/pim/ocontactaccess.h49
-rw-r--r--libopie/pim/ocontactaccessbackend_xml.h35
-rw-r--r--libopie/pim/opimaccesstemplate.h12
-rw-r--r--libopie/pim/otodoaccessxml.cpp2
-rw-r--r--libopie/pim/otodoaccessxml.h2
7 files changed, 37 insertions, 73 deletions
diff --git a/libopie/pim/DESIGN b/libopie/pim/DESIGN
index 4def7b9..bd92b1b 100644
--- a/libopie/pim/DESIGN
+++ b/libopie/pim/DESIGN
@@ -52,8 +52,2 @@ regards Holger 'zecke' Freyther
52 52
53Comment by Stefan Eilers:
54
55The opimaccesstemplate defines "SortOrder":
56I think sortorder is the wrong name for the meaning of it and
57it should be defined by the childs of opimaccesstemplate (every
58implementation may use different values for this..)
59 53
diff --git a/libopie/pim/ocontactaccess.cpp b/libopie/pim/ocontactaccess.cpp
index b5f358b..e8c0a45 100644
--- a/libopie/pim/ocontactaccess.cpp
+++ b/libopie/pim/ocontactaccess.cpp
@@ -23,2 +23,5 @@
23 * $Log$ 23 * $Log$
24 * Revision 1.4 2002/10/14 16:21:54 eilers
25 * Some minor interface updates
26 *
24 * Revision 1.3 2002/10/07 17:34:24 eilers 27 * Revision 1.3 2002/10/07 17:34:24 eilers
@@ -68,3 +71,2 @@ OContactAccess::OContactAccess ( const QString appname, const QString ,
68 if( end == 0 ) { 71 if( end == 0 ) {
69 // __asm__("int3");
70 qWarning ("Using BackendFactory !"); 72 qWarning ("Using BackendFactory !");
diff --git a/libopie/pim/ocontactaccess.h b/libopie/pim/ocontactaccess.h
index 54f7f07..adc66cf 100644
--- a/libopie/pim/ocontactaccess.h
+++ b/libopie/pim/ocontactaccess.h
@@ -19,2 +19,5 @@
19 * $Log$ 19 * $Log$
20 * Revision 1.2 2002/10/14 16:21:54 eilers
21 * Some minor interface updates
22 *
20 * Revision 1.1 2002/09/27 17:11:44 eilers 23 * Revision 1.1 2002/09/27 17:11:44 eilers
@@ -49,34 +52,2 @@ class OContactAccess: public QObject, public OPimAccessTemplate<OContact>
49 52
50
51 /* class Iterator{
52 friend OContactAccess;
53 public:
54 Iterator();
55 Iterator ( const Iterator& copy );
56
57 bool operator== ( const Iterator& it );
58 bool operator!= ( const Iterator& it );
59 Iterator& operator= ( const Iterator& it );
60 Iterator& operator++ (); // prefix
61 Iterator operator++ ( int ); // postfix
62 Iterator& operator-- (); // prefix
63 Iterator operator-- ( int ); // postfix
64 Contact operator*() const;
65 Contact operator->() const;
66
67 Iterator begin();
68 Iterator end();
69
70 uint count() const;
71
72 private:
73 QValueList<int> m_uids;
74 int m_cur_position;
75 bool m_end_reached;
76 OContactAccess *m_db;
77
78 };
79
80 */
81
82 public: 53 public:
@@ -93,3 +64,3 @@ class OContactAccess: public QObject, public OPimAccessTemplate<OContact>
93 * to react itself, it should be disabled by setting it to <b>false</b> 64 * to react itself, it should be disabled by setting it to <b>false</b>
94 * @see OContactBackend 65 * @see OContactAccessBackend
95 */ 66 */
@@ -103,9 +74,9 @@ class OContactAccess: public QObject, public OPimAccessTemplate<OContact>
103 * @see queryByExample() 74 * @see queryByExample()
104 * - why not enum - zecke?
105 * -> Had some implementation problems .. Will use enum soon ! .. (se)
106 */ 75 */
107 static const int query_WildCards = 0x0001; 76 enum QuerySettings {
108 static const int query_IgnoreCase = 0x0002; 77 WildCards = 0x0001,
109 static const int query_RegExp = 0x0004; 78 IgnoreCase = 0x0002,
110 static const int query_ExactMatch = 0x0008; 79 RegExp = 0x0004,
80 ExactMatch = 0x0008,
81 };
111 82
diff --git a/libopie/pim/ocontactaccessbackend_xml.h b/libopie/pim/ocontactaccessbackend_xml.h
index 97ef40f..50ea329 100644
--- a/libopie/pim/ocontactaccessbackend_xml.h
+++ b/libopie/pim/ocontactaccessbackend_xml.h
@@ -19,2 +19,5 @@
19 * $Log$ 19 * $Log$
20 * Revision 1.3 2002/10/14 16:21:54 eilers
21 * Some minor interface updates
22 *
20 * Revision 1.2 2002/10/07 17:34:24 eilers 23 * Revision 1.2 2002/10/07 17:34:24 eilers
@@ -201,6 +204,6 @@ class OContactAccessBackend_XML : public OContactAccessBackend {
201 if ( !query.field(i).isEmpty() ){ 204 if ( !query.field(i).isEmpty() ){
202 switch ( settings & ~OContactAccess::query_IgnoreCase ){ 205 switch ( settings & ~OContactAccess::IgnoreCase ){
203 case OContactAccess::query_RegExp:{ 206 case OContactAccess::RegExp:{
204 QRegExp expr ( query.field(i), 207 QRegExp expr ( query.field(i),
205 !(settings & OContactAccess::query_IgnoreCase), 208 !(settings & OContactAccess::IgnoreCase),
206 false ); 209 false );
@@ -210,5 +213,5 @@ class OContactAccessBackend_XML : public OContactAccessBackend {
210 break; 213 break;
211 case OContactAccess::query_WildCards:{ 214 case OContactAccess::WildCards:{
212 QRegExp expr ( query.field(i), 215 QRegExp expr ( query.field(i),
213 !(settings & OContactAccess::query_IgnoreCase), 216 !(settings & OContactAccess::IgnoreCase),
214 true ); 217 true );
@@ -218,4 +221,4 @@ class OContactAccessBackend_XML : public OContactAccessBackend {
218 break; 221 break;
219 case OContactAccess::query_ExactMatch:{ 222 case OContactAccess::ExactMatch:{
220 if (settings & OContactAccess::query_IgnoreCase){ 223 if (settings & OContactAccess::IgnoreCase){
221 if ( query.field(i).upper() != 224 if ( query.field(i).upper() !=
@@ -245,6 +248,6 @@ class OContactAccessBackend_XML : public OContactAccessBackend {
245 { 248 {
246 return ( OContactAccess::query_WildCards 249 return ( OContactAccess::WildCards
247 & OContactAccess::query_IgnoreCase 250 & OContactAccess::IgnoreCase
248 & OContactAccess::query_RegExp 251 & OContactAccess::RegExp
249 & OContactAccess::query_ExactMatch ); 252 & OContactAccess::ExactMatch );
250 } 253 }
@@ -253,3 +256,3 @@ class OContactAccessBackend_XML : public OContactAccessBackend {
253 { 256 {
254 /* OContactAccess::query_IgnoreCase may be added with one 257 /* OContactAccess::IgnoreCase may be added with one
255 * of the other settings, but never used alone. 258 * of the other settings, but never used alone.
@@ -257,8 +260,8 @@ class OContactAccessBackend_XML : public OContactAccessBackend {
257 */ 260 */
258 switch ( querySettings & ~OContactAccess::query_IgnoreCase ){ 261 switch ( querySettings & ~OContactAccess::IgnoreCase ){
259 case OContactAccess::query_RegExp: 262 case OContactAccess::RegExp:
260 return ( true ); 263 return ( true );
261 case OContactAccess::query_WildCards: 264 case OContactAccess::WildCards:
262 return ( true ); 265 return ( true );
263 case OContactAccess::query_ExactMatch: 266 case OContactAccess::ExactMatch:
264 return ( true ); 267 return ( true );
diff --git a/libopie/pim/opimaccesstemplate.h b/libopie/pim/opimaccesstemplate.h
index a0d8f63..3e1f393 100644
--- a/libopie/pim/opimaccesstemplate.h
+++ b/libopie/pim/opimaccesstemplate.h
@@ -29,9 +29,2 @@ public:
29 /** 29 /**
30 * our sort order
31 * should be safe explaining
32 */
33 enum SortOrder { WildCards = 0, IgnoreCase = 1,
34 RegExp = 2, ExactMatch = 4 };
35
36 /**
37 * c'tor BackEnd 30 * c'tor BackEnd
@@ -68,5 +61,6 @@ public:
68 /** 61 /**
69 * queryByExample 62 * queryByExample)
63 * @see otodoaccess, ocontactaccess
70 */ 64 */
71 virtual List queryByExample( const T& t, int sortOrder ); 65 virtual List queryByExample( const T& t, int querySettings );
72 66
diff --git a/libopie/pim/otodoaccessxml.cpp b/libopie/pim/otodoaccessxml.cpp
index f3b0783..3b4cab2 100644
--- a/libopie/pim/otodoaccessxml.cpp
+++ b/libopie/pim/otodoaccessxml.cpp
@@ -189,3 +189,3 @@ QArray<int> OTodoAccessXML::allRecords()const {
189} 189}
190QArray<int> OTodoAccessXML::queryByExample( const OTodo&, int sort ) { 190QArray<int> OTodoAccessXML::queryByExample( const OTodo&, int ) {
191 QArray<int> ids(0); 191 QArray<int> ids(0);
diff --git a/libopie/pim/otodoaccessxml.h b/libopie/pim/otodoaccessxml.h
index 1e7e371..dc41c32 100644
--- a/libopie/pim/otodoaccessxml.h
+++ b/libopie/pim/otodoaccessxml.h
@@ -26,3 +26,3 @@ public:
26 QArray<int> allRecords()const; 26 QArray<int> allRecords()const;
27 QArray<int> queryByExample( const OTodo&, int sort ); 27 QArray<int> queryByExample( const OTodo&, int querysettings );
28 OTodo find( int uid )const; 28 OTodo find( int uid )const;