summaryrefslogtreecommitdiff
path: root/library/backend/contact.cpp
Unidiff
Diffstat (limited to 'library/backend/contact.cpp') (more/less context) (show whitespace changes)
-rw-r--r--library/backend/contact.cpp79
1 files changed, 47 insertions, 32 deletions
diff --git a/library/backend/contact.cpp b/library/backend/contact.cpp
index a5f10ab..b10b19a 100644
--- a/library/backend/contact.cpp
+++ b/library/backend/contact.cpp
@@ -18,6 +18,8 @@
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#define QTOPIA_INTERNAL_CONTACT_MRE
22
21#include "contact.h" 23#include "contact.h"
22#include "vobject_p.h" 24#include "vobject_p.h"
23#include "qfiledirect_p.h" 25#include "qfiledirect_p.h"
@@ -386,45 +388,49 @@ QStringList Contact::fields()
386 list.append( "Suffix" ); 388 list.append( "Suffix" );
387 list.append( "FileAs" ); 389 list.append( "FileAs" );
388 390
391 list.append( "JobTitle" );
392 list.append( "Department" );
393 list.append( "Company" );
394 list.append( "BusinessPhone" );
395 list.append( "BusinessFax" );
396 list.append( "BusinessMobile" );
397
389 list.append( "DefaultEmail" ); 398 list.append( "DefaultEmail" );
390 list.append( "Emails" ); 399 list.append( "Emails" );
391 400
392 list.append( "HomeStreet" );
393 list.append( "HomeCity" );
394 list.append( "HomeState" );
395 list.append( "HomeZip" );
396 list.append( "HomeCountry" );
397 list.append( "HomePhone" ); 401 list.append( "HomePhone" );
398 list.append( "HomeFax" ); 402 list.append( "HomeFax" );
399 list.append( "HomeMobile" ); 403 list.append( "HomeMobile" );
400 list.append( "HomeWebPage" );
401 404
402 list.append( "Company" );
403 list.append( "BusinessStreet" ); 405 list.append( "BusinessStreet" );
404 list.append( "BusinessCity" ); 406 list.append( "BusinessCity" );
405 list.append( "BusinessState" ); 407 list.append( "BusinessState" );
406 list.append( "BusinessZip" ); 408 list.append( "BusinessZip" );
407 list.append( "BusinessCountry" ); 409 list.append( "BusinessCountry" );
410 list.append( "BusinessPager" );
408 list.append( "BusinessWebPage" ); 411 list.append( "BusinessWebPage" );
409 list.append( "JobTitle" ); 412
410 list.append( "Department" );
411 list.append( "Office" ); 413 list.append( "Office" );
412 list.append( "BusinessPhone" );
413 list.append( "BusinessFax" );
414 list.append( "BusinessMobile" );
415 list.append( "BusinessPager" );
416 list.append( "Profession" ); 414 list.append( "Profession" );
417 list.append( "Assistant" ); 415 list.append( "Assistant" );
418 list.append( "Manager" ); 416 list.append( "Manager" );
419 417
418 list.append( "HomeStreet" );
419 list.append( "HomeCity" );
420 list.append( "HomeState" );
421 list.append( "HomeZip" );
422 list.append( "HomeCountry" );
423 list.append( "HomeWebPage" );
424
420 list.append( "Spouse" ); 425 list.append( "Spouse" );
421 list.append( "Gender" ); 426 list.append( "Gender" );
422 list.append( "Birthday" ); 427 list.append( "Birthday" );
423 list.append( "Anniversary" ); 428 list.append( "Anniversary" );
424 list.append( "Nickname" ); 429 list.append( "Nickname" );
425
426 list.append( "Children" ); 430 list.append( "Children" );
431
427 list.append( "Notes" ); 432 list.append( "Notes" );
433 list.append( "Groups" );
428 434
429 return list; 435 return list;
430} 436}
@@ -440,45 +446,49 @@ QStringList Contact::trfields()
440 list.append( QObject::tr( "Suffix" ) ); 446 list.append( QObject::tr( "Suffix" ) );
441 list.append( QObject::tr( "File As" ) ); 447 list.append( QObject::tr( "File As" ) );
442 448
449 list.append( QObject::tr( "Job Title" ) );
450 list.append( QObject::tr( "Department" ) );
451 list.append( QObject::tr( "Company" ) );
452 list.append( QObject::tr( "Business Phone" ) );
453 list.append( QObject::tr( "Business Fax" ) );
454 list.append( QObject::tr( "Business Mobile" ) );
455
443 list.append( QObject::tr( "Default Email" ) ); 456 list.append( QObject::tr( "Default Email" ) );
444 list.append( QObject::tr( "Emails" ) ); 457 list.append( QObject::tr( "Emails" ) );
445 458
446 list.append( QObject::tr( "Home Street" ) );
447 list.append( QObject::tr( "Home City" ) );
448 list.append( QObject::tr( "Home State" ) );
449 list.append( QObject::tr( "Home Zip" ) );
450 list.append( QObject::tr( "Home Country" ) );
451 list.append( QObject::tr( "Home Phone" ) ); 459 list.append( QObject::tr( "Home Phone" ) );
452 list.append( QObject::tr( "Home Fax" ) ); 460 list.append( QObject::tr( "Home Fax" ) );
453 list.append( QObject::tr( "Home Mobile" ) ); 461 list.append( QObject::tr( "Home Mobile" ) );
454 list.append( QObject::tr( "Home Web Page" ) );
455 462
456 list.append( QObject::tr( "Company" ) );
457 list.append( QObject::tr( "Business Street" ) ); 463 list.append( QObject::tr( "Business Street" ) );
458 list.append( QObject::tr( "Business City" ) ); 464 list.append( QObject::tr( "Business City" ) );
459 list.append( QObject::tr( "Business State" ) ); 465 list.append( QObject::tr( "Business State" ) );
460 list.append( QObject::tr( "Business Zip" ) ); 466 list.append( QObject::tr( "Business Zip" ) );
461 list.append( QObject::tr( "Business Country" ) ); 467 list.append( QObject::tr( "Business Country" ) );
468 list.append( QObject::tr( "Business Pager" ) );
462 list.append( QObject::tr( "Business WebPage" ) ); 469 list.append( QObject::tr( "Business WebPage" ) );
463 list.append( QObject::tr( "Job Title" ) ); 470
464 list.append( QObject::tr( "Department" ) );
465 list.append( QObject::tr( "Office" ) ); 471 list.append( QObject::tr( "Office" ) );
466 list.append( QObject::tr( "Business Phone" ) );
467 list.append( QObject::tr( "Business Fax" ) );
468 list.append( QObject::tr( "Business Mobile" ) );
469 list.append( QObject::tr( "Business Pager" ) );
470 list.append( QObject::tr( "Profession" ) ); 472 list.append( QObject::tr( "Profession" ) );
471 list.append( QObject::tr( "Assistant" ) ); 473 list.append( QObject::tr( "Assistant" ) );
472 list.append( QObject::tr( "Manager" ) ); 474 list.append( QObject::tr( "Manager" ) );
473 475
476 list.append( QObject::tr( "Home Street" ) );
477 list.append( QObject::tr( "Home City" ) );
478 list.append( QObject::tr( "Home State" ) );
479 list.append( QObject::tr( "Home Zip" ) );
480 list.append( QObject::tr( "Home Country" ) );
481 list.append( QObject::tr( "Home Web Page" ) );
482
474 list.append( QObject::tr( "Spouse" ) ); 483 list.append( QObject::tr( "Spouse" ) );
475 list.append( QObject::tr( "Gender" ) ); 484 list.append( QObject::tr( "Gender" ) );
476 list.append( QObject::tr( "Birthday" ) ); 485 list.append( QObject::tr( "Birthday" ) );
477 list.append( QObject::tr( "Anniversary" ) ); 486 list.append( QObject::tr( "Anniversary" ) );
478 list.append( QObject::tr( "Nickname" ) ); 487 list.append( QObject::tr( "Nickname" ) );
479
480 list.append( QObject::tr( "Children" ) ); 488 list.append( QObject::tr( "Children" ) );
489
481 list.append( QObject::tr( "Notes" ) ); 490 list.append( QObject::tr( "Notes" ) );
491 list.append( QObject::tr( "Groups" ) );
482 492
483 return list; 493 return list;
484} 494}
@@ -629,7 +639,7 @@ static Contact parseVObject( VObject *obj )
629 initPropIterator( &nit, o ); 639 initPropIterator( &nit, o );
630 while( moreIteration( &nit ) ) { 640 while( moreIteration( &nit ) ) {
631 VObject *o = nextVObject( &nit ); 641 VObject *o = nextVObject( &nit );
632 QCString name = vObjectName( o ); 642 QCString name = vObjectTypeInfo( o );
633 QString value = vObjectStringZValue( o ); 643 QString value = vObjectStringZValue( o );
634 if ( name == VCNamePrefixesProp ) 644 if ( name == VCNamePrefixesProp )
635 c.setTitle( value ); 645 c.setTitle( value );
@@ -702,7 +712,7 @@ static Contact parseVObject( VObject *obj )
702 initPropIterator( &nit, o ); 712 initPropIterator( &nit, o );
703 while( moreIteration( &nit ) ) { 713 while( moreIteration( &nit ) ) {
704 VObject *o = nextVObject( &nit ); 714 VObject *o = nextVObject( &nit );
705 QCString name = vObjectName( o ); 715 QCString name = vObjectTypeInfo( o );
706 if ( name == VCHomeProp ) 716 if ( name == VCHomeProp )
707 type |= HOME; 717 type |= HOME;
708 else if ( name == VCWorkProp ) 718 else if ( name == VCWorkProp )
@@ -749,7 +759,7 @@ static Contact parseVObject( VObject *obj )
749 initPropIterator( &nit, o ); 759 initPropIterator( &nit, o );
750 while( moreIteration( &nit ) ) { 760 while( moreIteration( &nit ) ) {
751 VObject *o = nextVObject( &nit ); 761 VObject *o = nextVObject( &nit );
752 QCString name = vObjectName( o ); 762 QCString name = vObjectTypeInfo( o );
753 if ( name != VCInternetProp && name != VCHomeProp && 763 if ( name != VCInternetProp && name != VCHomeProp &&
754 name != VCWorkProp && 764 name != VCWorkProp &&
755 name != VCPreferredProp ) 765 name != VCPreferredProp )
@@ -772,7 +782,7 @@ static Contact parseVObject( VObject *obj )
772 initPropIterator( &nit, o ); 782 initPropIterator( &nit, o );
773 while( moreIteration( &nit ) ) { 783 while( moreIteration( &nit ) ) {
774 VObject *o = nextVObject( &nit ); 784 VObject *o = nextVObject( &nit );
775 QCString name = vObjectName( o ); 785 QCString name = vObjectTypeInfo( o );
776 if ( name == VCHomeProp ) 786 if ( name == VCHomeProp )
777 c.setHomeWebpage( value ); 787 c.setHomeWebpage( value );
778 else if ( name == VCWorkProp ) 788 else if ( name == VCWorkProp )
@@ -894,6 +904,11 @@ QValueList<Contact> Contact::readVCard( const QString &filename )
894 return contacts; 904 return contacts;
895} 905}
896 906
907bool Contact::match( const QString &regexp ) const
908{
909 return match(QRegExp(regexp));
910}
911
897bool Contact::match( const QRegExp &r ) const 912bool Contact::match( const QRegExp &r ) const
898{ 913{
899 bool match; 914 bool match;