Changeset 4 for libQtGdata/trunk/qtgdata_contact.cpp
- Timestamp:
- 02/05/10 00:24:31 (2 years ago)
- File:
-
- 1 edited
-
libQtGdata/trunk/qtgdata_contact.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libQtGdata/trunk/qtgdata_contact.cpp
r3 r4 1 1 #include "qtgdata_contacts.h" 2 3 #include <QUrl> 2 4 3 5 QtGdata_contact::QtGdata_contact() … … 6 8 } 7 9 8 void QtGdata_contact::set Name(const QString name)10 void QtGdata_contact::setTitle(const QString name) 9 11 { 10 this->name = name; 12 names.title = name; 13 } 14 15 void QtGdata_contact::setFullName(const QString name) 16 { 17 names.fullName = name; 18 } 19 20 void QtGdata_contact::setGivenName(const QString name) 21 { 22 names.givenName = name; 23 } 24 25 void QtGdata_contact::setFamilyName(const QString name) 26 { 27 names.familyName = name; 11 28 } 12 29 … … 20 37 * @param type What kind of email (home/work/other) 21 38 * @param primary Boolean indicating if this is the primary email 39 * 40 * @todo make sure there is exactly 1 primary email address 41 * @todo find out what to do with duplicated emails 22 42 */ 23 43 void QtGdata_contact::addEmail(const QString email, 24 const QtGdata_contact:: GDATA_CONTACT_EMAIL type,44 const QtGdata_contact::EMAIL type, 25 45 const bool primary) 26 46 { 27 this->email.insert(email, type); 47 QtGdata_contact::email e; 48 e.email = email; 49 e.type = type; 50 e.primary = primary; 28 51 29 if (primary) { 30 primary_email = email; 31 } 52 emails.append(e); 32 53 } 33 54 55 /** 56 * @param phonenumber The phone number to add 57 * @param type The type of phone number (home/work/pager/fax...) 58 * 59 * @todo Find out if duplicated numbers can occure (currently not posible) 60 */ 34 61 void QtGdata_contact::addPhone(const QString phonenumber, 35 const QtGdata_contact:: GDATA_CONTACT_PHONE type)62 const QtGdata_contact::PHONE type) 36 63 { 37 phone.insert(phonenumber, type); 64 QtGdata_contact::phone p; 65 p.phonenumber = phonenumber; 66 p.type = type; 67 68 phones.append(p); 38 69 } 39 70 40 71 /** 72 * @param gender The gender of the contact 73 * 74 * @todo Make sure this is valid (better of with enum) 75 */ 41 76 void QtGdata_contact::setGender(const QString gender) 42 77 { … … 44 79 } 45 80 81 /** 82 * @param link The link to the contact 83 * 84 * @todo Check if this is a valid url 85 */ 86 void QtGdata_contact::setLinkEdit(const QString link) 87 { 88 linkEdit = QUrl(link); 89 } 90 91 /** 92 * @param link The link to edit the contact 93 * 94 * @todo Check if this is a valid url 95 */ 96 void QtGdata_contact::setLinkSelf(const QString link) 97 { 98 linkSelf = QUrl(link); 99 } 100 101 /** 102 * Fill an address struct and add it to the list 103 */ 104 void QtGdata_contact::setAddress(const QString street, 105 const QString postcode, 106 const QString city, 107 const QString region, 108 const QString country, 109 const QtGdata_contact::ADDRESS type) 110 { 111 QtGdata_contact::address a; 112 a.street = street; 113 a.postcode = postcode; 114 a.city = city; 115 a.region = region; 116 a.country = country; 117 118 addresses.append(a); 119 } 120 46 121 QString QtGdata_contact::getName() 47 122 { 48 return name;123 return QString(); 49 124 } 50 125
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)