summaryrefslogtreecommitdiff
path: root/libopie/pim/opimrecord.h
Unidiff
Diffstat (limited to 'libopie/pim/opimrecord.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/opimrecord.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/libopie/pim/opimrecord.h b/libopie/pim/opimrecord.h
index 6e7c0da..494c78e 100644
--- a/libopie/pim/opimrecord.h
+++ b/libopie/pim/opimrecord.h
@@ -72,14 +72,22 @@ public:
72 */ 72 */
73 virtual QString type()const = 0; 73 virtual QString type()const = 0;
74 74
75 /** 75 /**
76 * matches the Records the regular expression? 76 * matches the Records the regular expression?
77 */ 77 */
78 virtual bool match( const QString &regexp ) const 78 virtual bool match( const QString &regexp ) const
79 {return Qtopia::Record::match(QRegExp(regexp));}; 79 {setLastHitField( -1 );
80 return Qtopia::Record::match(QRegExp(regexp));};
81
82 /**
83 * if implemented this function returns which item has been
84 * last hit by the match() function.
85 * or -1 if not implemented or no hit has occured
86 */
87 int lastHitField()const;
80 88
81 /** 89 /**
82 * converts the internal structure to a map 90 * converts the internal structure to a map
83 */ 91 */
84 virtual QMap<int, QString> toMap()const = 0; 92 virtual QMap<int, QString> toMap()const = 0;
85 93
@@ -118,12 +126,15 @@ public:
118 * to and from a DataStream 126 * to and from a DataStream
119 */ 127 */
120 virtual bool loadFromStream(QDataStream& ); 128 virtual bool loadFromStream(QDataStream& );
121 virtual bool saveToStream( QDataStream& stream )const; 129 virtual bool saveToStream( QDataStream& stream )const;
122 130
123protected: 131protected:
132 // need to be const cause it is called from const methods
133 mutable int m_lastHit;
134 void setLastHitField( int lastHit )const;
124 Qtopia::UidGen &uidGen(); 135 Qtopia::UidGen &uidGen();
125// QString crossToString()const; 136// QString crossToString()const;
126 137
127private: 138private:
128 class OPimRecordPrivate; 139 class OPimRecordPrivate;
129 OPimRecordPrivate *d; 140 OPimRecordPrivate *d;