summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimrecord.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/core/opimrecord.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimrecord.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h
index 6e7c0da..494c78e 100644
--- a/libopie2/opiepim/core/opimrecord.h
+++ b/libopie2/opiepim/core/opimrecord.h
@@ -67,25 +67,33 @@ public:
67 */ 67 */
68 virtual QString toShortText()const = 0; 68 virtual QString toShortText()const = 0;
69 69
70 /** 70 /**
71 * the name of the Record 71 * the name of the Record
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
86 /** 94 /**
87 * key value representation of extra items 95 * key value representation of extra items
88 */ 96 */
89 virtual QMap<QString, QString> toExtraMap()const = 0; 97 virtual QMap<QString, QString> toExtraMap()const = 0;
90 98
91 /** 99 /**
@@ -112,24 +120,27 @@ public:
112 */ 120 */
113 static int rtti(); 121 static int rtti();
114 122
115 /** 123 /**
116 * some marshalling and de marshalling code 124 * some marshalling and de marshalling code
117 * saves the OPimRecord 125 * saves the OPimRecord
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;
130 OPimXRefManager m_xrefman; 141 OPimXRefManager m_xrefman;
131 static Qtopia::UidGen m_uidGen; 142 static Qtopia::UidGen m_uidGen;
132 143
133private: 144private:
134 void flush( const OPimXRefPartner&, QDataStream& stream )const; 145 void flush( const OPimXRefPartner&, QDataStream& stream )const;
135 OPimXRefPartner partner( QDataStream& ); 146 OPimXRefPartner partner( QDataStream& );