-rw-r--r-- | libopie2/opiepim/ocontact.h | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/libopie2/opiepim/ocontact.h b/libopie2/opiepim/ocontact.h index 34888dc..445fd7d 100644 --- a/libopie2/opiepim/ocontact.h +++ b/libopie2/opiepim/ocontact.h | |||
@@ -21,52 +21,57 @@ | |||
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | #ifndef __OCONTACT_H__ | ||
30 | #define __OCONTACT_H__ | ||
31 | 29 | ||
30 | #ifndef OCONTACT_H | ||
31 | #define OCONTACT_H | ||
32 | |||
33 | /* OPIE */ | ||
32 | #include <opie2/opimrecord.h> | 34 | #include <opie2/opimrecord.h> |
33 | #include <qpe/recordfields.h> | 35 | #include <qpe/recordfields.h> |
34 | 36 | ||
37 | /* QT */ | ||
35 | #include <qdatetime.h> | 38 | #include <qdatetime.h> |
36 | #include <qstringlist.h> | 39 | #include <qstringlist.h> |
37 | 40 | ||
38 | #if defined(QPC_TEMPLATEDLL) | 41 | #if defined(QPC_TEMPLATEDLL) |
39 | // MOC_SKIP_BEGIN | 42 | // MOC_SKIP_BEGIN |
40 | QPC_TEMPLATEEXTERN template class QPC_EXPORT QMap<int, QString>; | 43 | QPC_TEMPLATEEXTERN template class QPC_EXPORT QMap<int, QString>; |
41 | // MOC_SKIP_END | 44 | // MOC_SKIP_END |
42 | #endif | 45 | #endif |
43 | 46 | ||
44 | namespace Opie { | 47 | namespace Opie |
48 | { | ||
45 | class OContactPrivate; | 49 | class OContactPrivate; |
46 | 50 | ||
47 | /** | 51 | /** |
48 | * OContact class represents a specialised PIM Record for contacts. | 52 | * OContact class represents a specialised PIM Record for contacts. |
49 | * It does store all kind of persopn related information. | 53 | * It does store all kind of persopn related information. |
50 | * | 54 | * |
51 | * @short Contact Container | 55 | * @short Contact Container |
52 | * @author TT, Stefan Eiler, Holger Freyther | 56 | * @author TT, Stefan Eiler, Holger Freyther |
53 | */ | 57 | */ |
54 | class QPC_EXPORT OContact : public OPimRecord | 58 | class QPC_EXPORT OContact : public OPimRecord |
55 | { | 59 | { |
56 | friend class DataSet; | 60 | friend class DataSet; |
57 | public: | 61 | |
62 | public: | ||
58 | OContact(); | 63 | OContact(); |
59 | OContact( const QMap<int, QString> &fromMap ); | 64 | OContact( const QMap<int, QString> &fromMap ); |
60 | virtual ~OContact(); | 65 | virtual ~OContact(); |
61 | 66 | ||
62 | enum DateFormat{ | 67 | enum DateFormat{ |
63 | Zip_City_State = 0, | 68 | Zip_City_State = 0, |
64 | City_State_Zip | 69 | City_State_Zip |
65 | }; | 70 | }; |
66 | 71 | ||
67 | /* | 72 | /* |
68 | * do we need to inline them | 73 | * do we need to inline them |
69 | * if yes do we need to inline them this way? | 74 | * if yes do we need to inline them this way? |
70 | * -zecke | 75 | * -zecke |
71 | */ | 76 | */ |
72 | void setTitle( const QString &v ) { replace( Qtopia::Title, v ); } | 77 | void setTitle( const QString &v ) { replace( Qtopia::Title, v ); } |
@@ -119,23 +124,23 @@ public: | |||
119 | void setSpouse( const QString &v ) { replace( Qtopia::Spouse, v ); } | 124 | void setSpouse( const QString &v ) { replace( Qtopia::Spouse, v ); } |
120 | void setGender( const QString &v ) { replace( Qtopia::Gender, v ); } | 125 | void setGender( const QString &v ) { replace( Qtopia::Gender, v ); } |
121 | void setBirthday( const QDate &v ); | 126 | void setBirthday( const QDate &v ); |
122 | void setAnniversary( const QDate &v ); | 127 | void setAnniversary( const QDate &v ); |
123 | void setNickname( const QString &v ) { replace( Qtopia::Nickname, v ); } | 128 | void setNickname( const QString &v ) { replace( Qtopia::Nickname, v ); } |
124 | void setChildren( const QString &v ); | 129 | void setChildren( const QString &v ); |
125 | 130 | ||
126 | // other | 131 | // other |
127 | void setNotes( const QString &v ) { replace( Qtopia::Notes, v); } | 132 | void setNotes( const QString &v ) { replace( Qtopia::Notes, v ); } |
128 | 133 | ||
129 | virtual bool match( const QRegExp ®exp ) const; | 134 | virtual bool match( const QRegExp ®exp ) const; |
130 | 135 | ||
131 | // // custom | 136 | // // custom |
132 | // void setCustomField( const QString &key, const QString &v ) | 137 | // void setCustomField( const QString &key, const QString &v ) |
133 | // { replace(Custom- + key, v ); } | 138 | // { replace(Custom- + key, v ); } |
134 | 139 | ||
135 | // name | 140 | // name |
136 | QString fullName() const; | 141 | QString fullName() const; |
137 | QString title() const { return find( Qtopia::Title ); } | 142 | QString title() const { return find( Qtopia::Title ); } |
138 | QString firstName() const { return find( Qtopia::FirstName ); } | 143 | QString firstName() const { return find( Qtopia::FirstName ); } |
139 | QString middleName() const { return find( Qtopia::MiddleName ); } | 144 | QString middleName() const { return find( Qtopia::MiddleName ); } |
140 | QString lastName() const { return find( Qtopia::LastName ); } | 145 | QString lastName() const { return find( Qtopia::LastName ); } |
141 | QString suffix() const { return find( Qtopia::Suffix ); } | 146 | QString suffix() const { return find( Qtopia::Suffix ); } |
@@ -180,17 +185,17 @@ public: | |||
180 | QString office() const { return find( Qtopia::Office ); } | 185 | QString office() const { return find( Qtopia::Office ); } |
181 | QString businessPhone() const { return find( Qtopia::BusinessPhone ); } | 186 | QString businessPhone() const { return find( Qtopia::BusinessPhone ); } |
182 | QString businessFax() const { return find( Qtopia::BusinessFax ); } | 187 | QString businessFax() const { return find( Qtopia::BusinessFax ); } |
183 | QString businessMobile() const { return find( Qtopia::BusinessMobile ); } | 188 | QString businessMobile() const { return find( Qtopia::BusinessMobile ); } |
184 | QString businessPager() const { return find( Qtopia::BusinessPager ); } | 189 | QString businessPager() const { return find( Qtopia::BusinessPager ); } |
185 | QString profession() const { return find( Qtopia::Profession ); } | 190 | QString profession() const { return find( Qtopia::Profession ); } |
186 | QString assistant() const { return find( Qtopia::Assistant ); } | 191 | QString assistant() const { return find( Qtopia::Assistant ); } |
187 | QString manager() const { return find( Qtopia::Manager ); } | 192 | QString manager() const { return find( Qtopia::Manager ); } |
188 | /** Multi line string containing all non-empty address info in the form | 193 | /** Multi line string containing all non-empty address info in the form |
189 | * Street | 194 | * Street |
190 | * City, State Zip | 195 | * City, State Zip |
191 | * Country | 196 | * Country |
192 | */ | 197 | */ |
193 | QString displayBusinessAddress() const; | 198 | QString displayBusinessAddress() const; |
194 | 199 | ||
195 | //personal | 200 | //personal |
196 | QString spouse() const { return find( Qtopia::Spouse ); } | 201 | QString spouse() const { return find( Qtopia::Spouse ); } |
@@ -208,44 +213,44 @@ public: | |||
208 | 213 | ||
209 | QString toRichText() const; | 214 | QString toRichText() const; |
210 | QMap<int, QString> toMap() const; | 215 | QMap<int, QString> toMap() const; |
211 | QString field( int key ) const { return find( key ); } | 216 | QString field( int key ) const { return find( key ); } |
212 | 217 | ||
213 | 218 | ||
214 | void setUid( int i ); | 219 | void setUid( int i ); |
215 | 220 | ||
216 | QString toShortText()const; | 221 | QString toShortText() const; |
217 | QString type()const; | 222 | QString type() const; |
218 | class QString recordField(int) const; | 223 | class QString recordField( int ) const; |
219 | 224 | ||
220 | // Why private ? (eilers,se) | 225 | // Why private ? (eilers,se) |
221 | QString emailSeparator() const { return " "; } | 226 | QString emailSeparator() const { return " "; } |
222 | 227 | ||
223 | // the emails should be seperated by a comma | 228 | // the emails should be seperated by a comma |
224 | void setEmails( const QString &v ); | 229 | void setEmails( const QString &v ); |
225 | QString emails() const { return find( Qtopia::Emails ); } | 230 | QString emails() const { return find( Qtopia::Emails ); } |
226 | static int rtti(); | 231 | static int rtti(); |
227 | 232 | ||
228 | private: | 233 | private: |
229 | // The XML Backend needs some access to the private functions | 234 | // The XML Backend needs some access to the private functions |
230 | friend class OContactAccessBackend_XML; | 235 | friend class OContactAccessBackend_XML; |
231 | 236 | ||
232 | void insert( int key, const QString &value ); | 237 | void insert( int key, const QString &value ); |
233 | void replace( int key, const QString &value ); | 238 | void replace( int key, const QString &value ); |
234 | QString find( int key ) const; | 239 | QString find( int key ) const; |
235 | static QStringList fields(); | 240 | static QStringList fields(); |
236 | 241 | ||
237 | void save( QString &buf ) const; | 242 | void save( QString &buf ) const; |
238 | 243 | ||
239 | QString displayAddress( const QString &street, | 244 | QString displayAddress( const QString &street, |
240 | const QString &city, | 245 | const QString &city, |
241 | const QString &state, | 246 | const QString &state, |
242 | const QString &zip, | 247 | const QString &zip, |
243 | const QString &country ) const; | 248 | const QString &country ) const; |
244 | 249 | ||
245 | QMap<int, QString> mMap; | 250 | QMap<int, QString> mMap; |
246 | OContactPrivate *d; | 251 | OContactPrivate *d; |
247 | }; | 252 | }; |
248 | 253 | ||
249 | } | 254 | } |
250 | 255 | ||
251 | #endif | 256 | #endif |