summaryrefslogtreecommitdiff
path: root/library/backend/contact.cpp
Side-by-side diff
Diffstat (limited to 'library/backend/contact.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/backend/contact.cpp107
1 files changed, 61 insertions, 46 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,9 +18,11 @@
**
**********************************************************************/
+#define QTOPIA_INTERNAL_CONTACT_MRE
+
#include "contact.h"
-#include "vobject_p.h"
-#include "qfiledirect_p.h"
+#include "vobject_p.h"
+#include "qfiledirect_p.h"
#include <qpe/stringutil.h>
#include <qpe/timeconversion.h>
@@ -386,45 +388,49 @@ QStringList Contact::fields()
list.append( "Suffix" );
list.append( "FileAs" );
+ list.append( "JobTitle" );
+ list.append( "Department" );
+ list.append( "Company" );
+ list.append( "BusinessPhone" );
+ list.append( "BusinessFax" );
+ list.append( "BusinessMobile" );
+
list.append( "DefaultEmail" );
list.append( "Emails" );
- list.append( "HomeStreet" );
- list.append( "HomeCity" );
- list.append( "HomeState" );
- list.append( "HomeZip" );
- list.append( "HomeCountry" );
list.append( "HomePhone" );
list.append( "HomeFax" );
list.append( "HomeMobile" );
- list.append( "HomeWebPage" );
- list.append( "Company" );
list.append( "BusinessStreet" );
list.append( "BusinessCity" );
list.append( "BusinessState" );
list.append( "BusinessZip" );
list.append( "BusinessCountry" );
+ list.append( "BusinessPager" );
list.append( "BusinessWebPage" );
- list.append( "JobTitle" );
- list.append( "Department" );
+
list.append( "Office" );
- list.append( "BusinessPhone" );
- list.append( "BusinessFax" );
- list.append( "BusinessMobile" );
- list.append( "BusinessPager" );
list.append( "Profession" );
list.append( "Assistant" );
list.append( "Manager" );
+ list.append( "HomeStreet" );
+ list.append( "HomeCity" );
+ list.append( "HomeState" );
+ list.append( "HomeZip" );
+ list.append( "HomeCountry" );
+ list.append( "HomeWebPage" );
+
list.append( "Spouse" );
list.append( "Gender" );
list.append( "Birthday" );
list.append( "Anniversary" );
list.append( "Nickname" );
-
list.append( "Children" );
+
list.append( "Notes" );
+ list.append( "Groups" );
return list;
}
@@ -440,45 +446,49 @@ QStringList Contact::trfields()
list.append( QObject::tr( "Suffix" ) );
list.append( QObject::tr( "File As" ) );
+ list.append( QObject::tr( "Job Title" ) );
+ list.append( QObject::tr( "Department" ) );
+ list.append( QObject::tr( "Company" ) );
+ list.append( QObject::tr( "Business Phone" ) );
+ list.append( QObject::tr( "Business Fax" ) );
+ list.append( QObject::tr( "Business Mobile" ) );
+
list.append( QObject::tr( "Default Email" ) );
list.append( QObject::tr( "Emails" ) );
- list.append( QObject::tr( "Home Street" ) );
- list.append( QObject::tr( "Home City" ) );
- list.append( QObject::tr( "Home State" ) );
- list.append( QObject::tr( "Home Zip" ) );
- list.append( QObject::tr( "Home Country" ) );
list.append( QObject::tr( "Home Phone" ) );
list.append( QObject::tr( "Home Fax" ) );
list.append( QObject::tr( "Home Mobile" ) );
- list.append( QObject::tr( "Home Web Page" ) );
- list.append( QObject::tr( "Company" ) );
list.append( QObject::tr( "Business Street" ) );
list.append( QObject::tr( "Business City" ) );
list.append( QObject::tr( "Business State" ) );
list.append( QObject::tr( "Business Zip" ) );
list.append( QObject::tr( "Business Country" ) );
+ list.append( QObject::tr( "Business Pager" ) );
list.append( QObject::tr( "Business WebPage" ) );
- list.append( QObject::tr( "Job Title" ) );
- list.append( QObject::tr( "Department" ) );
+
list.append( QObject::tr( "Office" ) );
- list.append( QObject::tr( "Business Phone" ) );
- list.append( QObject::tr( "Business Fax" ) );
- list.append( QObject::tr( "Business Mobile" ) );
- list.append( QObject::tr( "Business Pager" ) );
list.append( QObject::tr( "Profession" ) );
list.append( QObject::tr( "Assistant" ) );
list.append( QObject::tr( "Manager" ) );
+ list.append( QObject::tr( "Home Street" ) );
+ list.append( QObject::tr( "Home City" ) );
+ list.append( QObject::tr( "Home State" ) );
+ list.append( QObject::tr( "Home Zip" ) );
+ list.append( QObject::tr( "Home Country" ) );
+ list.append( QObject::tr( "Home Web Page" ) );
+
list.append( QObject::tr( "Spouse" ) );
list.append( QObject::tr( "Gender" ) );
list.append( QObject::tr( "Birthday" ) );
list.append( QObject::tr( "Anniversary" ) );
list.append( QObject::tr( "Nickname" ) );
-
list.append( QObject::tr( "Children" ) );
+
list.append( QObject::tr( "Notes" ) );
+ list.append( QObject::tr( "Groups" ) );
return list;
}
@@ -629,7 +639,7 @@ static Contact parseVObject( VObject *obj )
initPropIterator( &nit, o );
while( moreIteration( &nit ) ) {
VObject *o = nextVObject( &nit );
- QCString name = vObjectName( o );
+ QCString name = vObjectTypeInfo( o );
QString value = vObjectStringZValue( o );
if ( name == VCNamePrefixesProp )
c.setTitle( value );
@@ -702,7 +712,7 @@ static Contact parseVObject( VObject *obj )
initPropIterator( &nit, o );
while( moreIteration( &nit ) ) {
VObject *o = nextVObject( &nit );
- QCString name = vObjectName( o );
+ QCString name = vObjectTypeInfo( o );
if ( name == VCHomeProp )
type |= HOME;
else if ( name == VCWorkProp )
@@ -749,7 +759,7 @@ static Contact parseVObject( VObject *obj )
initPropIterator( &nit, o );
while( moreIteration( &nit ) ) {
VObject *o = nextVObject( &nit );
- QCString name = vObjectName( o );
+ QCString name = vObjectTypeInfo( o );
if ( name != VCInternetProp && name != VCHomeProp &&
name != VCWorkProp &&
name != VCPreferredProp )
@@ -772,7 +782,7 @@ static Contact parseVObject( VObject *obj )
initPropIterator( &nit, o );
while( moreIteration( &nit ) ) {
VObject *o = nextVObject( &nit );
- QCString name = vObjectName( o );
+ QCString name = vObjectTypeInfo( o );
if ( name == VCHomeProp )
c.setHomeWebpage( value );
else if ( name == VCWorkProp )
@@ -842,12 +852,12 @@ static Contact parseVObject( VObject *obj )
}
void Contact::writeVCard( const QString &filename, const QValueList<Contact> &contacts)
-{
- QFileDirect f( filename.utf8().data() );
- if ( !f.open( IO_WriteOnly ) ) {
- qWarning("Unable to open vcard write");
- return;
- }
+{
+ QFileDirect f( filename.utf8().data() );
+ if ( !f.open( IO_WriteOnly ) ) {
+ qWarning("Unable to open vcard write");
+ return;
+ }
QValueList<Contact>::ConstIterator it;
for( it = contacts.begin(); it != contacts.end(); ++it ) {
@@ -859,12 +869,12 @@ void Contact::writeVCard( const QString &filename, const QValueList<Contact> &co
}
void Contact::writeVCard( const QString &filename, const Contact &contact)
-{
- QFileDirect f( filename.utf8().data() );
- if ( !f.open( IO_WriteOnly ) ) {
- qWarning("Unable to open vcard write");
- return;
- }
+{
+ QFileDirect f( filename.utf8().data() );
+ if ( !f.open( IO_WriteOnly ) ) {
+ qWarning("Unable to open vcard write");
+ return;
+ }
VObject *obj = createVObject( contact );
writeVObject( f.directHandle() , obj );
@@ -894,6 +904,11 @@ QValueList<Contact> Contact::readVCard( const QString &filename )
return contacts;
}
+bool Contact::match( const QString &regexp ) const
+{
+ return match(QRegExp(regexp));
+}
+
bool Contact::match( const QRegExp &r ) const
{
bool match;