-rw-r--r-- | libopie2/opiepim/ChangeLog | 3 | ||||
-rw-r--r-- | libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp | 1 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessbackend.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessbackend.h | 2 | ||||
-rw-r--r-- | libopie2/opiepim/core/ocontactaccess.cpp | 9 | ||||
-rw-r--r-- | libopie2/opiepim/core/ocontactaccess.h | 15 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimaccesstemplate.h | 43 |
7 files changed, 40 insertions, 35 deletions
diff --git a/libopie2/opiepim/ChangeLog b/libopie2/opiepim/ChangeLog index 2007744..320b189 100644 --- a/libopie2/opiepim/ChangeLog +++ b/libopie2/opiepim/ChangeLog | |||
@@ -1,3 +1,6 @@ | |||
1 | 2005-01-03 Stefan Eilers <stefan@eilers-online.net> | ||
2 | * Fixing bug in API documentation | ||
3 | * Moving hasQuerySettings() and querySettings() to OPimAccessTemplate to be available for all frontends | ||
1 | 2004-12-28 Stefan Eilers <stefan@eilers-online.net> | 4 | 2004-12-28 Stefan Eilers <stefan@eilers-online.net> |
2 | * Make improved query by example accessable via frontend | 5 | * Make improved query by example accessable via frontend |
3 | * Some API documentation improvement | 6 | * Some API documentation improvement |
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp index 41b714e..629e4da 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp | |||
@@ -208,6 +208,7 @@ QArray<int> ODateBookAccessBackend_SQL::allRecords()const | |||
208 | } | 208 | } |
209 | 209 | ||
210 | QArray<int> ODateBookAccessBackend_SQL::queryByExample(const OPimEvent&, int, const QDateTime& ) { | 210 | QArray<int> ODateBookAccessBackend_SQL::queryByExample(const OPimEvent&, int, const QDateTime& ) { |
211 | qDebug( "Accessing ODateBookAccessBackend_SQL::queryByExample() which is not implemented!" ); | ||
211 | return QArray<int>(); | 212 | return QArray<int>(); |
212 | } | 213 | } |
213 | 214 | ||
diff --git a/libopie2/opiepim/backend/otodoaccessbackend.cpp b/libopie2/opiepim/backend/otodoaccessbackend.cpp index f979976..c7ce123 100644 --- a/libopie2/opiepim/backend/otodoaccessbackend.cpp +++ b/libopie2/opiepim/backend/otodoaccessbackend.cpp | |||
@@ -54,7 +54,7 @@ bool OPimTodoAccessBackend::hasQuerySettings (uint querySettings) const | |||
54 | 54 | ||
55 | 55 | ||
56 | UIDArray OPimTodoAccessBackend::queryByExample( const UIDArray& uidlist, const OPimTodo& query, int settings, | 56 | UIDArray OPimTodoAccessBackend::queryByExample( const UIDArray& uidlist, const OPimTodo& query, int settings, |
57 | const QDateTime& endperiod )const | 57 | const QDateTime& startperiod )const |
58 | { | 58 | { |
59 | qDebug( "Accessing OPimTodoAccessBackend::queryByExample() which is not implemented!" ); | 59 | qDebug( "Accessing OPimTodoAccessBackend::queryByExample() which is not implemented!" ); |
60 | return UIDArray(); | 60 | return UIDArray(); |
diff --git a/libopie2/opiepim/backend/otodoaccessbackend.h b/libopie2/opiepim/backend/otodoaccessbackend.h index 870ee57..06cece3 100644 --- a/libopie2/opiepim/backend/otodoaccessbackend.h +++ b/libopie2/opiepim/backend/otodoaccessbackend.h | |||
@@ -64,7 +64,7 @@ public: | |||
64 | */ | 64 | */ |
65 | bool hasQuerySettings (uint querySettings) const; | 65 | bool hasQuerySettings (uint querySettings) const; |
66 | 66 | ||
67 | UIDArray queryByExample( const UIDArray& uidlist, const OPimTodo& query, int settings, const QDateTime& endperiod = QDateTime() )const; | 67 | UIDArray queryByExample( const UIDArray& uidlist, const OPimTodo& query, int settings, const QDateTime& startperiod = QDateTime() )const; |
68 | UIDArray sorted( const UIDArray&, bool asc, int, int, const QArray<int>& )const; | 68 | UIDArray sorted( const UIDArray&, bool asc, int, int, const QArray<int>& )const; |
69 | OPimBackendOccurrence::List occurrences( const QDate&, const QDate& )const; | 69 | OPimBackendOccurrence::List occurrences( const QDate&, const QDate& )const; |
70 | //@} | 70 | //@} |
diff --git a/libopie2/opiepim/core/ocontactaccess.cpp b/libopie2/opiepim/core/ocontactaccess.cpp index 9bbc820..9d18d47 100644 --- a/libopie2/opiepim/core/ocontactaccess.cpp +++ b/libopie2/opiepim/core/ocontactaccess.cpp | |||
@@ -118,15 +118,6 @@ bool OPimContactAccess::save () | |||
118 | return true; | 118 | return true; |
119 | } | 119 | } |
120 | 120 | ||
121 | const uint OPimContactAccess::querySettings() | ||
122 | { | ||
123 | return ( m_backEnd->querySettings() ); | ||
124 | } | ||
125 | |||
126 | bool OPimContactAccess::hasQuerySettings ( int querySettings ) const | ||
127 | { | ||
128 | return ( m_backEnd->hasQuerySettings ( querySettings ) ); | ||
129 | } | ||
130 | 121 | ||
131 | #if 0 | 122 | #if 0 |
132 | OPimRecordList<OPimContact> OPimContactAccess::sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const | 123 | OPimRecordList<OPimContact> OPimContactAccess::sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const |
diff --git a/libopie2/opiepim/core/ocontactaccess.h b/libopie2/opiepim/core/ocontactaccess.h index 5051321..9a2ecaf 100644 --- a/libopie2/opiepim/core/ocontactaccess.h +++ b/libopie2/opiepim/core/ocontactaccess.h | |||
@@ -116,21 +116,6 @@ class OPimContactAccess: public QObject, public OPimAccessTemplate<OPimContact> | |||
116 | ~OPimContactAccess (); | 116 | ~OPimContactAccess (); |
117 | 117 | ||
118 | 118 | ||
119 | /** | ||
120 | * Return all possible settings for queryByExample(). | ||
121 | * @return All settings provided by the current backend | ||
122 | * (i.e.: WildCards & IgnoreCase) | ||
123 | * @see QuerySettings in OPimBase for details of the parameter, queryByExample() | ||
124 | */ | ||
125 | const uint querySettings(); | ||
126 | |||
127 | /** | ||
128 | * Check whether settings are correct for queryByExample(). | ||
129 | * @return <i>true</i> if the given settings are correct and possible. | ||
130 | * @see QuerySettings in OPimBase for details of the parameter | ||
131 | */ | ||
132 | bool hasQuerySettings ( int querySettings ) const; | ||
133 | |||
134 | /** | 119 | /** |
135 | * if the resource was changed externally. | 120 | * if the resource was changed externally. |
136 | * You should use the signal instead of polling possible changes ! | 121 | * You should use the signal instead of polling possible changes ! |
diff --git a/libopie2/opiepim/core/opimaccesstemplate.h b/libopie2/opiepim/core/opimaccesstemplate.h index 3875f09..823f03d 100644 --- a/libopie2/opiepim/core/opimaccesstemplate.h +++ b/libopie2/opiepim/core/opimaccesstemplate.h | |||
@@ -87,45 +87,60 @@ public: | |||
87 | virtual List allRecords()const; | 87 | virtual List allRecords()const; |
88 | virtual List matchRegexp( const QRegExp &r ) const; | 88 | virtual List matchRegexp( const QRegExp &r ) const; |
89 | 89 | ||
90 | /** | ||
91 | * Return all possible settings for queryByExample(). | ||
92 | * @return All settings provided by the current backend | ||
93 | * (i.e.: WildCards & IgnoreCase) | ||
94 | * @see QuerySettings in OPimBase for details of the parameter, queryByExample() | ||
95 | */ | ||
96 | const uint querySettings(); | ||
97 | |||
98 | /** | ||
99 | * Check whether settings are correct for queryByExample(). | ||
100 | * @return <i>true</i> if the given settings are correct and possible. | ||
101 | * @see QuerySettings in OPimBase for details of the parameter | ||
102 | */ | ||
103 | bool hasQuerySettings ( int querySettings ) const; | ||
104 | |||
90 | /** | 105 | /** |
91 | * Query by example search interface. | 106 | * Query by example search interface. |
92 | * "Query by Example" provides a very powerful search engine. Use the query object | 107 | * "Query by Example" provides a very powerful search engine. Use the query object |
93 | * (this may be a contact, a todo or databook event) | 108 | * (this may be a contact, a todo or databook event) |
94 | * as a search mask which is converted into a query regarding the querySettings. If a time period is needed | 109 | * as a search mask which is converted into a query regarding the querySettings. If a time period is needed |
95 | * (as for OpimBase::DateDiff), you have to use the date/time in the query object and the endperiod (the last parameter). | 110 | * (as for OpimBase::DateDiff), you have to use the date/time in the query object and the startperiod (the last parameter). |
96 | * @see QuerySettings in class OPimBase | 111 | * @see QuerySettings in class OPimBase |
97 | * @param query The object which contains the query set | 112 | * @param query The object which contains the query set |
98 | * @param querySettings This parameter defines what should be searched and how the query should be interpreted | 113 | * @param querySettings This parameter defines what should be searched and how the query should be interpreted |
99 | * @param endperiod Defines the end of a period for some special queries. | 114 | * @param startperiod Defines the start of a period for some special queries. |
100 | */ | 115 | */ |
101 | virtual List queryByExample( const T& query, int querySettings, const QDateTime& endperiod = QDateTime() ); | 116 | virtual List queryByExample( const T& query, int querySettings, const QDateTime& startperiod = QDateTime() ); |
102 | 117 | ||
103 | /** | 118 | /** |
104 | * Generic query by example search interface. This is a special version which handles generic OPimRecord types. They are converted | 119 | * Generic query by example search interface. This is a special version which handles generic OPimRecord types. They are converted |
105 | * automatically into the right datatype. | 120 | * automatically into the right datatype. |
106 | * "Query by Example" provides a very powerful search engine. Use the query object (this may be a contact, a todo or databook event) | 121 | * "Query by Example" provides a very powerful search engine. Use the query object (this may be a contact, a todo or databook event) |
107 | * as a search mask which is converted into a query regarding the querySettings. If a time period is needed | 122 | * as a search mask which is converted into a query regarding the querySettings. If a time period is needed |
108 | * (as for OpimBase::DateDiff), you have to use the date/time in the query object and the endperiod (the last parameter). | 123 | * (as for OpimBase::DateDiff), you have to use the date/time in the query object and the startperiod (the last parameter). |
109 | * @see QuerySettings in class OPimBase | 124 | * @see QuerySettings in class OPimBase |
110 | * @param query The object which contains the query set | 125 | * @param query The object which contains the query set |
111 | * @param querySettings This parameter defines what should be searched and how the query should be interpreted | 126 | * @param querySettings This parameter defines what should be searched and how the query should be interpreted |
112 | * @param endperiod Defines the end of a period for some special queries. | 127 | * @param startperiod Defines the start of a period for some special queries. |
113 | */ | 128 | */ |
114 | virtual List queryByExample( const OPimRecord* query, int querySettings, const QDateTime& endperiod = QDateTime() ); | 129 | virtual List queryByExample( const OPimRecord* query, int querySettings, const QDateTime& startperiod = QDateTime() ); |
115 | /** | 130 | /** |
116 | * Incremental query by example search interface. Providing incremental search, this one provides the feature | 131 | * Incremental query by example search interface. Providing incremental search, this one provides the feature |
117 | * to search in a list of records which may be returned by an other search. | 132 | * to search in a list of records which may be returned by an other search. |
118 | * "Query by Example" provides a very powerful search engine. Use the query object (this may be a contact, a todo or databook event) | 133 | * "Query by Example" provides a very powerful search engine. Use the query object (this may be a contact, a todo or databook event) |
119 | * as a search mask which is converted into a query regarding the querySettings. If a time period is needed | 134 | * as a search mask which is converted into a query regarding the querySettings. If a time period is needed |
120 | * (as for OpimBase::DateDiff), you have to use the date/time in the query object and the endperiod (the last parameter). | 135 | * (as for OpimBase::DateDiff), you have to use the date/time in the query object and the startperiod (the last parameter). |
121 | * @see QuerySettings in class OPimBase | 136 | * @see QuerySettings in class OPimBase |
122 | * @param uidlist List of uid's which should be incorporated into the next search | 137 | * @param uidlist List of uid's which should be incorporated into the next search |
123 | * @param query The object which contains the query set | 138 | * @param query The object which contains the query set |
124 | * @param querySettings This parameter defines what should be searched and how the query should be interpreted | 139 | * @param querySettings This parameter defines what should be searched and how the query should be interpreted |
125 | * @param endperiod Defines the end of a period for some special queries. | 140 | * @param startperiod Defines the start of a period for some special queries. |
126 | */ | 141 | */ |
127 | virtual List queryByExample( const OPimAccessTemplate::List& uidlist, const T& query, int querySettings, | 142 | virtual List queryByExample( const OPimAccessTemplate::List& uidlist, const T& query, int querySettings, |
128 | const QDateTime& endperiod = QDateTime() ); | 143 | const QDateTime& startperiod = QDateTime() ); |
129 | 144 | ||
130 | virtual T find( UID uid )const; | 145 | virtual T find( UID uid )const; |
131 | virtual T find( UID uid, const QArray<int>&, | 146 | virtual T find( UID uid, const QArray<int>&, |
@@ -308,6 +323,16 @@ QArray<int> OPimAccessTemplate<T>::records()const { | |||
308 | return m_backEnd->allRecords(); | 323 | return m_backEnd->allRecords(); |
309 | } | 324 | } |
310 | 325 | ||
326 | template <class T> | ||
327 | const uint OPimAccessTemplate<T>::querySettings(){ | ||
328 | return m_backEnd->querySettings(); | ||
329 | } | ||
330 | |||
331 | template <class T> | ||
332 | bool OPimAccessTemplate<T>::hasQuerySettings ( int querySettings ) const { | ||
333 | return m_backEnd->hasQuerySettings( querySettings ); | ||
334 | } | ||
335 | |||
311 | 336 | ||
312 | template <class T> | 337 | template <class T> |
313 | typename OPimAccessTemplate<T>::List | 338 | typename OPimAccessTemplate<T>::List |