Changeset 4 for libQtGdata/trunk/qtgdata_contacts.h
- Timestamp:
- 02/05/10 00:24:31 (2 years ago)
- File:
-
- 1 edited
-
libQtGdata/trunk/qtgdata_contacts.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libQtGdata/trunk/qtgdata_contacts.h
r3 r4 8 8 #include <QDateTime> 9 9 #include <QMap> 10 #include <QUrl> 11 #include <QList> 10 12 11 13 class QtGdata_contact 12 14 { 13 15 public: 14 enum GDATA_CONTACT_EMAIL { 15 GDATA_CONTACT_EMAIL_OTHER, 16 GDATA_CONTACT_EMAIL_HOME, 17 GDATA_CONTACT_EMAIL_WORK, 16 enum ADDRESS { 17 ADDRESS_OTHER 18 18 }; 19 19 20 enum GDATA_CONTACT_PHONE { 21 GDATA_CONTACT_PHONE_OTHER, 22 GDATA_CONTACT_PHONE_HOME, 23 GDATA_CONTACT_PHONE_HOME_FAX, 24 GDATA_CONTACT_PHONE_WORK, 25 GDATA_CONTACT_PHONE_WORK_FAX, 26 GDATA_CONTACT_PHONE_MOBILE, 27 GDATA_CONTACT_PHONE_PAGER 20 enum EMAIL { 21 EMAIL_OTHER, 22 EMAIL_HOME, 23 EMAIL_WORK, 28 24 }; 25 26 enum GENDER { 27 GENDER_MALE, 28 GENDER_FEMALE 29 }; 30 31 enum PHONE { 32 PHONE_OTHER, 33 PHONE_HOME, 34 PHONE_HOME_FAX, 35 PHONE_WORK, 36 PHONE_WORK_FAX, 37 PHONE_MOBILE, 38 PHONE_PAGER 39 }; 40 41 typedef struct address { 42 QString street; 43 QString postcode; 44 QString city; 45 QString region; 46 QString country; 47 48 QString formattedAddress; /* Overkill?*/ 49 50 QtGdata_contact::ADDRESS type; 51 } address; 52 53 typedef struct email { 54 QString email; 55 QtGdata_contact::EMAIL type; 56 bool primary; 57 } email; 58 59 typedef struct name { 60 QString title; 61 QString fullName; 62 QString givenName; 63 QString familyName; 64 } name; 65 66 typedef struct phone { 67 QString phonenumber; 68 QtGdata_contact::PHONE type; 69 } phone; 29 70 30 71 QtGdata_contact(); … … 37 78 /* Adders */ 38 79 void addEmail(const QString email, 39 const QtGdata_contact:: GDATA_CONTACT_EMAIL type = QtGdata_contact::GDATA_CONTACT_EMAIL_OTHER,80 const QtGdata_contact::EMAIL type = QtGdata_contact::EMAIL_OTHER, 40 81 const bool primary = false); 41 82 void addPhone(const QString phonenumber, 42 const QtGdata_contact:: GDATA_CONTACT_PHONE type = QtGdata_contact::GDATA_CONTACT_PHONE_OTHER);83 const QtGdata_contact::PHONE type = QtGdata_contact::PHONE_OTHER); 43 84 44 85 /* Setters */ 86 void setAddress(const QString street, 87 const QString postcode, 88 const QString city, 89 const QString region, 90 const QString country, 91 const QtGdata_contact::ADDRESS type = QtGdata_contact::ADDRESS_OTHER); 45 92 void setGender(const QString gender); 93 void setLinkEdit(const QString link); 94 void setLinkSelf(const QString link); 46 95 void setName(const QString name); 47 96 void setUpdated(const QDateTime updated); 48 97 98 /* Set names */ 99 void setTitle(const QString name); 100 void setFullName(const QString name); 101 void setGivenName(const QString name); 102 void setFamilyName(const QString name); 103 49 104 private: 50 105 //QDate birthday; 51 Q Map<QString, QtGdata_contact::GDATA_CONTACT_EMAIL> email;52 Q String primary_email;106 QList<address> addresses; 107 QList<email> emails; 53 108 QString gender; 54 QString name;55 Q Map<QString, QtGdata_contact::GDATA_CONTACT_PHONE> phone;109 name names; 110 QList<phone> phones; 56 111 QDateTime updated; 112 113 114 QUrl linkEdit; 115 QUrl linkSelf; 57 116 }; 58 117
Note: See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)