summaryrefslogtreecommitdiffabout
path: root/kabc/field.cpp
Unidiff
Diffstat (limited to 'kabc/field.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/field.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/kabc/field.cpp b/kabc/field.cpp
index 20885de..6f2b307 100644
--- a/kabc/field.cpp
+++ b/kabc/field.cpp
@@ -75,33 +75,34 @@ class Field::FieldImpl
75 MobilePhone, 75 MobilePhone,
76 HomeFax, 76 HomeFax,
77 BusinessFax, 77 BusinessFax,
78 CarPhone, 78 CarPhone,
79 Isdn, 79 Isdn,
80 Pager, 80 Pager,
81 Email, 81 Email,
82 Mailer, 82 Mailer,
83 Title, 83 Title,
84 Role, 84 Role,
85 Organization, 85 Organization,
86 Note, 86 Note,
87 Url, 87 Url,
88 Resource, 88 Resource,
89 Sip, 89 Sip,
90 MobileWorkPhone, 90 MobileWorkPhone,
91 MobileHomePhone 91 MobileHomePhone,
92 OtherPhone
92 }; 93 };
93 94
94 int fieldId() { return mFieldId; } 95 int fieldId() { return mFieldId; }
95 int category() { return mCategory; } 96 int category() { return mCategory; }
96 97
97 QString label() { return mLabel; } 98 QString label() { return mLabel; }
98 QString key() { return mKey; } 99 QString key() { return mKey; }
99 QString app() { return mApp; } 100 QString app() { return mApp; }
100 101
101 private: 102 private:
102 int mFieldId; 103 int mFieldId;
103 int mCategory; 104 int mCategory;
104 105
105 QString mLabel; 106 QString mLabel;
106 QString mKey; 107 QString mKey;
107 QString mApp; 108 QString mApp;
@@ -193,32 +194,34 @@ QString Field::label()
193 case FieldImpl::Title: 194 case FieldImpl::Title:
194 return Addressee::titleLabel(); 195 return Addressee::titleLabel();
195 case FieldImpl::Role: 196 case FieldImpl::Role:
196 return Addressee::roleLabel(); 197 return Addressee::roleLabel();
197 case FieldImpl::Organization: 198 case FieldImpl::Organization:
198 return Addressee::organizationLabel(); 199 return Addressee::organizationLabel();
199 case FieldImpl::Note: 200 case FieldImpl::Note:
200 return Addressee::noteLabel(); 201 return Addressee::noteLabel();
201 case FieldImpl::Url: 202 case FieldImpl::Url:
202 return Addressee::urlLabel(); 203 return Addressee::urlLabel();
203 case FieldImpl::Resource: 204 case FieldImpl::Resource:
204 return Addressee::resourceLabel(); 205 return Addressee::resourceLabel();
205 case FieldImpl::Category: 206 case FieldImpl::Category:
206 return Addressee::categoryLabel(); 207 return Addressee::categoryLabel();
207 case FieldImpl::Sip: 208 case FieldImpl::Sip:
208 return Addressee::sipLabel(); 209 return Addressee::sipLabel();
210 case FieldImpl::OtherPhone:
211 return Addressee::otherPhoneLabel();
209 case FieldImpl::CustomField: 212 case FieldImpl::CustomField:
210 return mImpl->label(); 213 return mImpl->label();
211 default: 214 default:
212 return i18n("Unknown Field"); 215 return i18n("Unknown Field");
213 } 216 }
214} 217}
215 218
216int Field::category() 219int Field::category()
217{ 220{
218 return mImpl->category(); 221 return mImpl->category();
219} 222}
220 223
221QString Field::categoryLabel( int category ) 224QString Field::categoryLabel( int category )
222{ 225{
223 switch ( category ) { 226 switch ( category ) {
224 case All: 227 case All:
@@ -297,32 +300,34 @@ QString Field::value( const KABC::Addressee &a )
297 case FieldImpl::MobileWorkPhone: 300 case FieldImpl::MobileWorkPhone:
298 return a.phoneNumber( PhoneNumber::Car ).number(); 301 return a.phoneNumber( PhoneNumber::Car ).number();
299 case FieldImpl::MobileHomePhone: 302 case FieldImpl::MobileHomePhone:
300 return a.phoneNumber( PhoneNumber::Cell ).number(); 303 return a.phoneNumber( PhoneNumber::Cell ).number();
301 case FieldImpl::HomeFax: 304 case FieldImpl::HomeFax:
302 return a.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax ).number(); 305 return a.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax ).number();
303 case FieldImpl::BusinessFax: 306 case FieldImpl::BusinessFax:
304 return a.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ).number(); 307 return a.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ).number();
305 case FieldImpl::CarPhone: 308 case FieldImpl::CarPhone:
306 return a.phoneNumber( PhoneNumber::Car ).number(); 309 return a.phoneNumber( PhoneNumber::Car ).number();
307 case FieldImpl::Isdn: 310 case FieldImpl::Isdn:
308 return a.phoneNumber( PhoneNumber::Isdn ).number(); 311 return a.phoneNumber( PhoneNumber::Isdn ).number();
309 case FieldImpl::Pager: 312 case FieldImpl::Pager:
310 return a.phoneNumber( PhoneNumber::Pager ).number(); 313 return a.phoneNumber( PhoneNumber::Pager ).number();
311 case FieldImpl::Sip: 314 case FieldImpl::Sip:
312 return a.phoneNumber( PhoneNumber::Pcs | PhoneNumber::Pref ).number(); 315 return a.phoneNumber( PhoneNumber::Pcs | PhoneNumber::Pref ).number();
316 case FieldImpl::OtherPhone:
317 return a.phoneNumber( PhoneNumber::Voice ).number();
313 case FieldImpl::HomeAddressStreet: 318 case FieldImpl::HomeAddressStreet:
314 return a.address( Address::Home ).street(); 319 return a.address( Address::Home ).street();
315 case FieldImpl::HomeAddressLocality: 320 case FieldImpl::HomeAddressLocality:
316 return a.address( Address::Home ).locality(); 321 return a.address( Address::Home ).locality();
317 case FieldImpl::HomeAddressRegion: 322 case FieldImpl::HomeAddressRegion:
318 return a.address( Address::Home ).region(); 323 return a.address( Address::Home ).region();
319 case FieldImpl::HomeAddressPostalCode: 324 case FieldImpl::HomeAddressPostalCode:
320 return a.address( Address::Home ).postalCode(); 325 return a.address( Address::Home ).postalCode();
321 case FieldImpl::HomeAddressCountry: 326 case FieldImpl::HomeAddressCountry:
322 return a.address( Address::Home ).country(); 327 return a.address( Address::Home ).country();
323 case FieldImpl::BusinessAddressStreet: 328 case FieldImpl::BusinessAddressStreet:
324 return a.address( Address::Work ).street(); 329 return a.address( Address::Work ).street();
325 case FieldImpl::BusinessAddressLocality: 330 case FieldImpl::BusinessAddressLocality:
326 return a.address( Address::Work ).locality(); 331 return a.address( Address::Work ).locality();
327 case FieldImpl::BusinessAddressRegion: 332 case FieldImpl::BusinessAddressRegion:
328 return a.address( Address::Work ).region(); 333 return a.address( Address::Work ).region();
@@ -429,32 +434,33 @@ Field::List Field::allFields()
429 createField( FieldImpl::MobileHomePhone, Frequent ); 434 createField( FieldImpl::MobileHomePhone, Frequent );
430 createField( FieldImpl::MobileWorkPhone, Frequent ); 435 createField( FieldImpl::MobileWorkPhone, Frequent );
431 createField( FieldImpl::HomeFax ); 436 createField( FieldImpl::HomeFax );
432 createField( FieldImpl::BusinessFax ); 437 createField( FieldImpl::BusinessFax );
433 createField( FieldImpl::CarPhone ); 438 createField( FieldImpl::CarPhone );
434 createField( FieldImpl::Isdn ); 439 createField( FieldImpl::Isdn );
435 createField( FieldImpl::Pager ); 440 createField( FieldImpl::Pager );
436 createField( FieldImpl::Email, Email|Frequent ); 441 createField( FieldImpl::Email, Email|Frequent );
437 createField( FieldImpl::Mailer, Email ); 442 createField( FieldImpl::Mailer, Email );
438 createField( FieldImpl::Title, Organization ); 443 createField( FieldImpl::Title, Organization );
439 createField( FieldImpl::Role, Organization ); 444 createField( FieldImpl::Role, Organization );
440 createField( FieldImpl::Organization, Organization ); 445 createField( FieldImpl::Organization, Organization );
441 createField( FieldImpl::Note ); 446 createField( FieldImpl::Note );
442 createField( FieldImpl::Url ); 447 createField( FieldImpl::Url );
443 createField( FieldImpl::Resource ); 448 createField( FieldImpl::Resource );
444 createField( FieldImpl::Sip ); 449 createField( FieldImpl::Sip );
450 createField( FieldImpl::OtherPhone );
445 } 451 }
446 452
447 return mAllFields; 453 return mAllFields;
448} 454}
449 455
450Field::List Field::defaultFields() 456Field::List Field::defaultFields()
451{ 457{
452 if ( mDefaultFields.isEmpty() ) { 458 if ( mDefaultFields.isEmpty() ) {
453 createDefaultField( FieldImpl::GivenName ); 459 createDefaultField( FieldImpl::GivenName );
454 createDefaultField( FieldImpl::FamilyName ); 460 createDefaultField( FieldImpl::FamilyName );
455 createDefaultField( FieldImpl::Email ); 461 createDefaultField( FieldImpl::Email );
456 } 462 }
457 463
458 return mDefaultFields; 464 return mDefaultFields;
459} 465}
460 466