Diffstat (limited to 'libopie2/opiepim/core/opimrecord.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimrecord.h | 66 |
1 files changed, 36 insertions, 30 deletions
diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h index 63a3a98..4981a41 100644 --- a/libopie2/opiepim/core/opimrecord.h +++ b/libopie2/opiepim/core/opimrecord.h | |||
@@ -27,12 +27,10 @@ | |||
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | #ifndef OPIE_PIM_RECORD_H | ||
30 | #define OPIE_PIM_RECORD_H | ||
31 | 29 | ||
32 | #include <qdatastream.h> | 30 | #ifndef OPIMRECORD_H |
33 | #include <qmap.h> | 31 | #define OPIMRECORD_H |
34 | #include <qstring.h> | ||
35 | #include <qstringlist.h> | ||
36 | 32 | ||
33 | /* OPIE */ | ||
34 | #include <opie2/opimxrefmanager.h> | ||
37 | /* | 35 | /* |
38 | * we need to get customMap which is private... | 36 | * we need to get customMap which is private... |
@@ -42,7 +40,12 @@ | |||
42 | #undef private | 40 | #undef private |
43 | 41 | ||
44 | #include <opie2/opimxrefmanager.h> | 42 | /* QT */ |
43 | #include <qdatastream.h> | ||
44 | #include <qmap.h> | ||
45 | #include <qstring.h> | ||
46 | #include <qstringlist.h> | ||
45 | 47 | ||
46 | namespace Opie { | 48 | namespace Opie |
49 | { | ||
47 | /** | 50 | /** |
48 | * This is the base class for | 51 | * This is the base class for |
@@ -50,6 +53,7 @@ namespace Opie { | |||
50 | * | 53 | * |
51 | */ | 54 | */ |
52 | class OPimRecord : public Qtopia::Record { | 55 | class OPimRecord : public Qtopia::Record |
53 | public: | 56 | { |
57 | public: | ||
54 | /** | 58 | /** |
55 | * c'tor | 59 | * c'tor |
@@ -57,5 +61,5 @@ public: | |||
57 | * uid of 1 will be assigned a new one | 61 | * uid of 1 will be assigned a new one |
58 | */ | 62 | */ |
59 | OPimRecord(int uid = 0); | 63 | OPimRecord( int uid = 0 ); |
60 | ~OPimRecord(); | 64 | ~OPimRecord(); |
61 | 65 | ||
@@ -73,5 +77,5 @@ public: | |||
73 | * category names resolved | 77 | * category names resolved |
74 | */ | 78 | */ |
75 | QStringList categoryNames( const QString& appname )const; | 79 | QStringList categoryNames( const QString& appname ) const; |
76 | 80 | ||
77 | /** | 81 | /** |
@@ -90,20 +94,20 @@ public: | |||
90 | * it's empty if it's 0 | 94 | * it's empty if it's 0 |
91 | */ | 95 | */ |
92 | virtual bool isEmpty()const; | 96 | virtual bool isEmpty() const; |
93 | 97 | ||
94 | /** | 98 | /** |
95 | * toRichText summary | 99 | * toRichText summary |
96 | */ | 100 | */ |
97 | virtual QString toRichText()const = 0; | 101 | virtual QString toRichText() const = 0; |
98 | 102 | ||
99 | /** | 103 | /** |
100 | * a small one line summary | 104 | * a small one line summary |
101 | */ | 105 | */ |
102 | virtual QString toShortText()const = 0; | 106 | virtual QString toShortText() const = 0; |
103 | 107 | ||
104 | /** | 108 | /** |
105 | * the name of the Record | 109 | * the name of the Record |
106 | */ | 110 | */ |
107 | virtual QString type()const = 0; | 111 | virtual QString type() const = 0; |
108 | 112 | ||
109 | /** | 113 | /** |
@@ -111,6 +115,8 @@ public: | |||
111 | */ | 115 | */ |
112 | virtual bool match( const QString ®exp ) const | 116 | virtual bool match( const QString ®exp ) const |
113 | {setLastHitField( -1 ); | 117 | { |
114 | return Qtopia::Record::match(QRegExp(regexp));}; | 118 | setLastHitField( -1 ); |
119 | return Qtopia::Record::match( QRegExp( regexp ) ); | ||
120 | }; | ||
115 | 121 | ||
116 | /** | 122 | /** |
@@ -119,10 +125,10 @@ public: | |||
119 | * or -1 if not implemented or no hit has occured | 125 | * or -1 if not implemented or no hit has occured |
120 | */ | 126 | */ |
121 | int lastHitField()const; | 127 | int lastHitField() const; |
122 | 128 | ||
123 | /** | 129 | /** |
124 | * converts the internal structure to a map | 130 | * converts the internal structure to a map |
125 | */ | 131 | */ |
126 | virtual QMap<int, QString> toMap()const = 0; | 132 | virtual QMap<int, QString> toMap() const = 0; |
127 | // virtual fromMap( const <int, QString>& map ) = 0; // Should be added in the future (eilers) | 133 | // virtual fromMap( const <int, QString>& map ) = 0; // Should be added in the future (eilers) |
128 | 134 | ||
@@ -130,5 +136,5 @@ public: | |||
130 | * key value representation of extra items | 136 | * key value representation of extra items |
131 | */ | 137 | */ |
132 | QMap<QString, QString> toExtraMap()const; | 138 | QMap<QString, QString> toExtraMap() const; |
133 | void setExtraMap( const QMap<QString, QString>& ); | 139 | void setExtraMap( const QMap<QString, QString>& ); |
134 | 140 | ||
@@ -136,5 +142,5 @@ public: | |||
136 | * the name for a recordField | 142 | * the name for a recordField |
137 | */ | 143 | */ |
138 | virtual QString recordField(int)const = 0; | 144 | virtual QString recordField( int ) const = 0; |
139 | 145 | ||
140 | /** | 146 | /** |
@@ -162,15 +168,15 @@ public: | |||
162 | * to and from a DataStream | 168 | * to and from a DataStream |
163 | */ | 169 | */ |
164 | virtual bool loadFromStream(QDataStream& ); | 170 | virtual bool loadFromStream( QDataStream& ); |
165 | virtual bool saveToStream( QDataStream& stream )const; | 171 | virtual bool saveToStream( QDataStream& stream ) const; |
166 | 172 | ||
167 | protected: | 173 | protected: |
168 | // need to be const cause it is called from const methods | 174 | // need to be const cause it is called from const methods |
169 | mutable int m_lastHit; | 175 | mutable int m_lastHit; |
170 | void setLastHitField( int lastHit )const; | 176 | void setLastHitField( int lastHit ) const; |
171 | Qtopia::UidGen &uidGen(); | 177 | Qtopia::UidGen &uidGen(); |
172 | // QString crossToString()const; | 178 | // QString crossToString()const; |
173 | 179 | ||
174 | private: | 180 | private: |
175 | class OPimRecordPrivate; | 181 | class OPimRecordPrivate; |
176 | OPimRecordPrivate *d; | 182 | OPimRecordPrivate *d; |
@@ -178,6 +184,6 @@ private: | |||
178 | static Qtopia::UidGen m_uidGen; | 184 | static Qtopia::UidGen m_uidGen; |
179 | 185 | ||
180 | private: | 186 | private: |
181 | void flush( const OPimXRefPartner&, QDataStream& stream )const; | 187 | void flush( const OPimXRefPartner&, QDataStream& stream ) const; |
182 | OPimXRefPartner partner( QDataStream& ); | 188 | OPimXRefPartner partner( QDataStream& ); |
183 | }; | 189 | }; |