-rw-r--r-- | libopie/pim/ocontact.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libopie/pim/ocontact.h b/libopie/pim/ocontact.h index dd2de17..9a1a8dc 100644 --- a/libopie/pim/ocontact.h +++ b/libopie/pim/ocontact.h | |||
@@ -11,65 +11,70 @@ | |||
11 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 11 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
12 | ** | 12 | ** |
13 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 13 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
14 | ** | 14 | ** |
15 | ** Contact info@trolltech.com if any conditions of this licensing are | 15 | ** Contact info@trolltech.com if any conditions of this licensing are |
16 | ** not clear to you. | 16 | ** not clear to you. |
17 | ** | 17 | ** |
18 | **********************************************************************/ | 18 | **********************************************************************/ |
19 | 19 | ||
20 | #ifndef __OCONTACT_H__ | 20 | #ifndef __OCONTACT_H__ |
21 | #define __OCONTACT_H__ | 21 | #define __OCONTACT_H__ |
22 | 22 | ||
23 | #include <opie/opimrecord.h> | 23 | #include <opie/opimrecord.h> |
24 | #include <qpe/recordfields.h> | 24 | #include <qpe/recordfields.h> |
25 | 25 | ||
26 | #include <qdatetime.h> | 26 | #include <qdatetime.h> |
27 | #include <qstringlist.h> | 27 | #include <qstringlist.h> |
28 | 28 | ||
29 | #if defined(QPC_TEMPLATEDLL) | 29 | #if defined(QPC_TEMPLATEDLL) |
30 | // MOC_SKIP_BEGIN | 30 | // MOC_SKIP_BEGIN |
31 | QPC_TEMPLATEEXTERN template class QPC_EXPORT QMap<int, QString>; | 31 | QPC_TEMPLATEEXTERN template class QPC_EXPORT QMap<int, QString>; |
32 | // MOC_SKIP_END | 32 | // MOC_SKIP_END |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | class ContactPrivate; | 35 | class OContactPrivate; |
36 | 36 | ||
37 | /** | 37 | /** |
38 | * OContact class represents a specialised PIM Record for contacts. | 38 | * OContact class represents a specialised PIM Record for contacts. |
39 | * It does store all kind of persopn related information. | 39 | * It does store all kind of persopn related information. |
40 | * | 40 | * |
41 | * @short Contact Container | 41 | * @short Contact Container |
42 | * @author TT, Stefan Eiler, Holger Freyther | 42 | * @author TT, Stefan Eiler, Holger Freyther |
43 | */ | 43 | */ |
44 | class QPC_EXPORT OContact : public OPimRecord | 44 | class QPC_EXPORT OContact : public OPimRecord |
45 | { | 45 | { |
46 | friend class DataSet; | 46 | friend class DataSet; |
47 | public: | 47 | public: |
48 | OContact(); | 48 | OContact(); |
49 | OContact( const QMap<int, QString> &fromMap ); | 49 | OContact( const QMap<int, QString> &fromMap ); |
50 | virtual ~OContact(); | 50 | virtual ~OContact(); |
51 | 51 | ||
52 | enum DateFormat{ | ||
53 | Zip_City_State = 0, | ||
54 | City_State_Zip | ||
55 | }; | ||
56 | |||
52 | /* | 57 | /* |
53 | * do we need to inline them | 58 | * do we need to inline them |
54 | * if yes do we need to inline them this way? | 59 | * if yes do we need to inline them this way? |
55 | * -zecke | 60 | * -zecke |
56 | */ | 61 | */ |
57 | void setTitle( const QString &v ) { replace( Qtopia::Title, v ); } | 62 | void setTitle( const QString &v ) { replace( Qtopia::Title, v ); } |
58 | void setFirstName( const QString &v ) { replace( Qtopia::FirstName, v ); } | 63 | void setFirstName( const QString &v ) { replace( Qtopia::FirstName, v ); } |
59 | void setMiddleName( const QString &v ) { replace( Qtopia::MiddleName, v ); } | 64 | void setMiddleName( const QString &v ) { replace( Qtopia::MiddleName, v ); } |
60 | void setLastName( const QString &v ) { replace( Qtopia::LastName, v ); } | 65 | void setLastName( const QString &v ) { replace( Qtopia::LastName, v ); } |
61 | void setSuffix( const QString &v ) { replace( Qtopia::Suffix, v ); } | 66 | void setSuffix( const QString &v ) { replace( Qtopia::Suffix, v ); } |
62 | void setFileAs( const QString &v ) { replace( Qtopia::FileAs, v ); } | 67 | void setFileAs( const QString &v ) { replace( Qtopia::FileAs, v ); } |
63 | void setFileAs(); | 68 | void setFileAs(); |
64 | 69 | ||
65 | // default email address | 70 | // default email address |
66 | void setDefaultEmail( const QString &v ); | 71 | void setDefaultEmail( const QString &v ); |
67 | // inserts email to list and ensure's doesn't already exist | 72 | // inserts email to list and ensure's doesn't already exist |
68 | void insertEmail( const QString &v ); | 73 | void insertEmail( const QString &v ); |
69 | void removeEmail( const QString &v ); | 74 | void removeEmail( const QString &v ); |
70 | void clearEmails(); | 75 | void clearEmails(); |
71 | void insertEmails( const QStringList &v ); | 76 | void insertEmails( const QStringList &v ); |
72 | 77 | ||
73 | // home | 78 | // home |
74 | void setHomeStreet( const QString &v ) { replace( Qtopia::HomeStreet, v ); } | 79 | void setHomeStreet( const QString &v ) { replace( Qtopia::HomeStreet, v ); } |
75 | void setHomeCity( const QString &v ) { replace( Qtopia::HomeCity, v ); } | 80 | void setHomeCity( const QString &v ) { replace( Qtopia::HomeCity, v ); } |
@@ -212,29 +217,29 @@ public: | |||
212 | QString emailSeparator() const { return " "; } | 217 | QString emailSeparator() const { return " "; } |
213 | // the emails should be seperated by a comma | 218 | // the emails should be seperated by a comma |
214 | void setEmails( const QString &v ); | 219 | void setEmails( const QString &v ); |
215 | QString emails() const { return find( Qtopia::Emails ); } | 220 | QString emails() const { return find( Qtopia::Emails ); } |
216 | static int rtti(); | 221 | static int rtti(); |
217 | 222 | ||
218 | private: | 223 | private: |
219 | // The XML-Backend needs some access to the private functions | 224 | // The XML-Backend needs some access to the private functions |
220 | friend class OContactAccessBackend_XML; | 225 | friend class OContactAccessBackend_XML; |
221 | 226 | ||
222 | void insert( int key, const QString &value ); | 227 | void insert( int key, const QString &value ); |
223 | void replace( int key, const QString &value ); | 228 | void replace( int key, const QString &value ); |
224 | QString find( int key ) const; | 229 | QString find( int key ) const; |
225 | static QStringList fields(); | 230 | static QStringList fields(); |
226 | 231 | ||
227 | void save( QString &buf ) const; | 232 | void save( QString &buf ) const; |
228 | 233 | ||
229 | QString displayAddress( const QString &street, | 234 | QString displayAddress( const QString &street, |
230 | const QString &city, | 235 | const QString &city, |
231 | const QString &state, | 236 | const QString &state, |
232 | const QString &zip, | 237 | const QString &zip, |
233 | const QString &country ) const; | 238 | const QString &country ) const; |
234 | 239 | ||
235 | QMap<int, QString> mMap; | 240 | QMap<int, QString> mMap; |
236 | ContactPrivate *d; | 241 | OContactPrivate *d; |
237 | }; | 242 | }; |
238 | 243 | ||
239 | 244 | ||
240 | #endif | 245 | #endif |