summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend
authortille <tille>2003-05-08 13:55:09 (UTC)
committer tille <tille>2003-05-08 13:55:09 (UTC)
commit0cb4111d34d9fe96731f48983e1ff2e67262db02 (patch) (side-by-side diff)
treece6ec869ae7753ab0261e7ad075a10ad8b0a404b /libopie2/opiepim/backend
parent78c60031b506b85dc20bd555d83486aeb831bf38 (diff)
downloadopie-0cb4111d34d9fe96731f48983e1ff2e67262db02.zip
opie-0cb4111d34d9fe96731f48983e1ff2e67262db02.tar.gz
opie-0cb4111d34d9fe96731f48983e1ff2e67262db02.tar.bz2
search stuff
and match, toRichText & toShortText in oevent
Diffstat (limited to 'libopie2/opiepim/backend') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp18
-rw-r--r--libopie2/opiepim/backend/odatebookaccessbackend_xml.h1
-rw-r--r--libopie2/opiepim/backend/opimaccessbackend.h6
-rw-r--r--libopie2/opiepim/backend/otodoaccessvcal.cpp4
-rw-r--r--libopie2/opiepim/backend/otodoaccessvcal.h1
-rw-r--r--libopie2/opiepim/backend/otodoaccessxml.cpp16
-rw-r--r--libopie2/opiepim/backend/otodoaccessxml.h1
7 files changed, 47 insertions, 0 deletions
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
index a0ae7b7..ab2eea4 100644
--- a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
+++ b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
@@ -583,6 +583,24 @@ void ODateBookAccessBackend_XML::setField( OEvent& e, int id, const QString& val
e.setTimeZone( value );
break;
default:
break;
}
}
+QArray<int> ODateBookAccessBackend_XML::matchRegexp( const QRegExp &r ) const
+{
+ QArray<int> m_currentQuery( m_raw.count()+ m_rep.count() );
+ uint arraycounter = 0;
+ QMap<int, OEvent>::ConstIterator it;
+
+ for ( it = m_raw.begin(); it != m_raw.end(); ++it )
+ if ( it.data().match( r ) )
+ m_currentQuery[arraycounter++] = it.data().uid();
+ for ( it = m_rep.begin(); it != m_rep.end(); ++it )
+ if ( it.data().match( r ) )
+ m_currentQuery[arraycounter++] = it.data().uid();
+
+ // Shrink to fit..
+ m_currentQuery.resize(arraycounter);
+
+ return m_currentQuery;
+}
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_xml.h b/libopie2/opiepim/backend/odatebookaccessbackend_xml.h
index 7848f7c..a5cc0fc 100644
--- a/libopie2/opiepim/backend/odatebookaccessbackend_xml.h
+++ b/libopie2/opiepim/backend/odatebookaccessbackend_xml.h
@@ -19,12 +19,13 @@ public:
bool load();
bool reload();
bool save();
QArray<int> allRecords()const;
+ QArray<int> matchRegexp(const QRegExp &r) const;
QArray<int> queryByExample( const OEvent&, int, const QDateTime& d = QDateTime() );
OEvent find( int uid )const;
void clear();
bool add( const OEvent& ev );
bool remove( int uid );
bool replace( const OEvent& ev );
diff --git a/libopie2/opiepim/backend/opimaccessbackend.h b/libopie2/opiepim/backend/opimaccessbackend.h
index 01a0c86..f4bbe35 100644
--- a/libopie2/opiepim/backend/opimaccessbackend.h
+++ b/libopie2/opiepim/backend/opimaccessbackend.h
@@ -44,12 +44,18 @@ public:
* return an array of
* all available uids
*/
virtual QArray<int> allRecords()const = 0;
/**
+ * return a List of records
+ * that match the regex
+ */
+ virtual QArray<int> matchRegexp(const QRegExp &r) const = 0;
+
+ /**
* queryByExample for T with the given Settings
*
*/
virtual QArray<int> queryByExample( const T& t, int settings, const QDateTime& d = QDateTime() ) = 0;
/**
diff --git a/libopie2/opiepim/backend/otodoaccessvcal.cpp b/libopie2/opiepim/backend/otodoaccessvcal.cpp
index 9bc16c6..3577e14 100644
--- a/libopie2/opiepim/backend/otodoaccessvcal.cpp
+++ b/libopie2/opiepim/backend/otodoaccessvcal.cpp
@@ -182,12 +182,16 @@ QArray<int> OTodoAccessVCal::allRecords()const {
for ( it = m_map.begin(); it != m_map.end(); ++it ) {
ar[i] = it.key();
i++;
}
return ar;
}
+QArray<int> OTodoAccessVCal::matchRegexp(const QRegExp &r)const {
+ QArray<int> ar(0);
+ return ar;
+}
QArray<int> OTodoAccessVCal::queryByExample( const OTodo&, int, const QDateTime& ) {
QArray<int> ar(0);
return ar;
}
QArray<int> OTodoAccessVCal::effectiveToDos( const QDate& ,
const QDate& ,
diff --git a/libopie2/opiepim/backend/otodoaccessvcal.h b/libopie2/opiepim/backend/otodoaccessvcal.h
index 489416b..2b17147 100644
--- a/libopie2/opiepim/backend/otodoaccessvcal.h
+++ b/libopie2/opiepim/backend/otodoaccessvcal.h
@@ -10,12 +10,13 @@ public:
bool load();
bool reload();
bool save();
QArray<int> allRecords()const;
+ QArray<int> matchRegexp(const QRegExp &r) const;
QArray<int> queryByExample( const OTodo& t, int sort, const QDateTime& d = QDateTime() );
QArray<int> effectiveToDos( const QDate& start,
const QDate& end,
bool includeNoDates );
QArray<int> overDue();
QArray<int> sorted( bool asc, int sortOrder, int sortFilter,
diff --git a/libopie2/opiepim/backend/otodoaccessxml.cpp b/libopie2/opiepim/backend/otodoaccessxml.cpp
index 285d2b8..69b7ab4 100644
--- a/libopie2/opiepim/backend/otodoaccessxml.cpp
+++ b/libopie2/opiepim/backend/otodoaccessxml.cpp
@@ -771,6 +771,22 @@ QBitArray OTodoAccessXML::sup() {
ar[OTodo::Reminders] = false;
ar[OTodo::Notifiers] = false;
ar[OTodo::Maintainer] = false;
return ar;
}
+QArray<int> OTodoAccessXML::matchRegexp( const QRegExp &r ) const
+{
+ QArray<int> m_currentQuery( m_events.count() );
+ uint arraycounter = 0;
+
+ QMap<int, OTodo>::ConstIterator it;
+ for (it = m_events.begin(); it != m_events.end(); ++it ) {
+ if ( it.data().match( r ) )
+ m_currentQuery[arraycounter++] = it.data().uid();
+
+ }
+ // Shrink to fit..
+ m_currentQuery.resize(arraycounter);
+
+ return m_currentQuery;
+}
diff --git a/libopie2/opiepim/backend/otodoaccessxml.h b/libopie2/opiepim/backend/otodoaccessxml.h
index cc4a16f..e4850a1 100644
--- a/libopie2/opiepim/backend/otodoaccessxml.h
+++ b/libopie2/opiepim/backend/otodoaccessxml.h
@@ -21,12 +21,13 @@ public:
bool load();
bool reload();
bool save();
QArray<int> allRecords()const;
+ QArray<int> matchRegexp(const QRegExp &r) const;
QArray<int> queryByExample( const OTodo&, int querysettings, const QDateTime& d = QDateTime() );
OTodo find( int uid )const;
void clear();
bool add( const OTodo& );
bool remove( int uid );
void removeAllCompleted();