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) (unidiff)
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
583 e.setTimeZone( value ); 583 e.setTimeZone( value );
584 break; 584 break;
585 default: 585 default:
586 break; 586 break;
587 } 587 }
588} 588}
589QArray<int> ODateBookAccessBackend_XML::matchRegexp( const QRegExp &r ) const
590{
591 QArray<int> m_currentQuery( m_raw.count()+ m_rep.count() );
592 uint arraycounter = 0;
593 QMap<int, OEvent>::ConstIterator it;
594
595 for ( it = m_raw.begin(); it != m_raw.end(); ++it )
596 if ( it.data().match( r ) )
597 m_currentQuery[arraycounter++] = it.data().uid();
598 for ( it = m_rep.begin(); it != m_rep.end(); ++it )
599 if ( it.data().match( r ) )
600 m_currentQuery[arraycounter++] = it.data().uid();
601
602 // Shrink to fit..
603 m_currentQuery.resize(arraycounter);
604
605 return m_currentQuery;
606}
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:
19 19
20 bool load(); 20 bool load();
21 bool reload(); 21 bool reload();
22 bool save(); 22 bool save();
23 23
24 QArray<int> allRecords()const; 24 QArray<int> allRecords()const;
25 QArray<int> matchRegexp(const QRegExp &r) const;
25 QArray<int> queryByExample( const OEvent&, int, const QDateTime& d = QDateTime() ); 26 QArray<int> queryByExample( const OEvent&, int, const QDateTime& d = QDateTime() );
26 OEvent find( int uid )const; 27 OEvent find( int uid )const;
27 void clear(); 28 void clear();
28 bool add( const OEvent& ev ); 29 bool add( const OEvent& ev );
29 bool remove( int uid ); 30 bool remove( int uid );
30 bool replace( const OEvent& ev ); 31 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:
44 * return an array of 44 * return an array of
45 * all available uids 45 * all available uids
46 */ 46 */
47 virtual QArray<int> allRecords()const = 0; 47 virtual QArray<int> allRecords()const = 0;
48 48
49 /** 49 /**
50 * return a List of records
51 * that match the regex
52 */
53 virtual QArray<int> matchRegexp(const QRegExp &r) const = 0;
54
55 /**
50 * queryByExample for T with the given Settings 56 * queryByExample for T with the given Settings
51 * 57 *
52 */ 58 */
53 virtual QArray<int> queryByExample( const T& t, int settings, const QDateTime& d = QDateTime() ) = 0; 59 virtual QArray<int> queryByExample( const T& t, int settings, const QDateTime& d = QDateTime() ) = 0;
54 60
55 /** 61 /**
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 {
182 for ( it = m_map.begin(); it != m_map.end(); ++it ) { 182 for ( it = m_map.begin(); it != m_map.end(); ++it ) {
183 ar[i] = it.key(); 183 ar[i] = it.key();
184 i++; 184 i++;
185 } 185 }
186 return ar; 186 return ar;
187} 187}
188QArray<int> OTodoAccessVCal::matchRegexp(const QRegExp &r)const {
189 QArray<int> ar(0);
190 return ar;
191}
188QArray<int> OTodoAccessVCal::queryByExample( const OTodo&, int, const QDateTime& ) { 192QArray<int> OTodoAccessVCal::queryByExample( const OTodo&, int, const QDateTime& ) {
189 QArray<int> ar(0); 193 QArray<int> ar(0);
190 return ar; 194 return ar;
191} 195}
192QArray<int> OTodoAccessVCal::effectiveToDos( const QDate& , 196QArray<int> OTodoAccessVCal::effectiveToDos( const QDate& ,
193 const QDate& , 197 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:
10 10
11 bool load(); 11 bool load();
12 bool reload(); 12 bool reload();
13 bool save(); 13 bool save();
14 14
15 QArray<int> allRecords()const; 15 QArray<int> allRecords()const;
16 QArray<int> matchRegexp(const QRegExp &r) const;
16 QArray<int> queryByExample( const OTodo& t, int sort, const QDateTime& d = QDateTime() ); 17 QArray<int> queryByExample( const OTodo& t, int sort, const QDateTime& d = QDateTime() );
17 QArray<int> effectiveToDos( const QDate& start, 18 QArray<int> effectiveToDos( const QDate& start,
18 const QDate& end, 19 const QDate& end,
19 bool includeNoDates ); 20 bool includeNoDates );
20 QArray<int> overDue(); 21 QArray<int> overDue();
21 QArray<int> sorted( bool asc, int sortOrder, int sortFilter, 22 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() {
771 ar[OTodo::Reminders] = false; 771 ar[OTodo::Reminders] = false;
772 ar[OTodo::Notifiers] = false; 772 ar[OTodo::Notifiers] = false;
773 ar[OTodo::Maintainer] = false; 773 ar[OTodo::Maintainer] = false;
774 774
775 return ar; 775 return ar;
776} 776}
777QArray<int> OTodoAccessXML::matchRegexp( const QRegExp &r ) const
778{
779 QArray<int> m_currentQuery( m_events.count() );
780 uint arraycounter = 0;
781
782 QMap<int, OTodo>::ConstIterator it;
783 for (it = m_events.begin(); it != m_events.end(); ++it ) {
784 if ( it.data().match( r ) )
785 m_currentQuery[arraycounter++] = it.data().uid();
786
787 }
788 // Shrink to fit..
789 m_currentQuery.resize(arraycounter);
790
791 return m_currentQuery;
792}
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:
21 21
22 bool load(); 22 bool load();
23 bool reload(); 23 bool reload();
24 bool save(); 24 bool save();
25 25
26 QArray<int> allRecords()const; 26 QArray<int> allRecords()const;
27 QArray<int> matchRegexp(const QRegExp &r) const;
27 QArray<int> queryByExample( const OTodo&, int querysettings, const QDateTime& d = QDateTime() ); 28 QArray<int> queryByExample( const OTodo&, int querysettings, const QDateTime& d = QDateTime() );
28 OTodo find( int uid )const; 29 OTodo find( int uid )const;
29 void clear(); 30 void clear();
30 bool add( const OTodo& ); 31 bool add( const OTodo& );
31 bool remove( int uid ); 32 bool remove( int uid );
32 void removeAllCompleted(); 33 void removeAllCompleted();