|
|
@ -33,58 +33,58 @@
|
|
|
|
#include "KWMailMergeKABC.h"
|
|
|
|
#include "KWMailMergeKABC.h"
|
|
|
|
#include "KWMailMergeKABCConfig.h"
|
|
|
|
#include "KWMailMergeKABCConfig.h"
|
|
|
|
|
|
|
|
|
|
|
|
KWMailMergeKABC::KWMailMergeKABC( TDEInstance *inst, TQObject *parent )
|
|
|
|
KWMailMergeTDEABC::KWMailMergeKABC( TDEInstance *inst, TQObject *parent )
|
|
|
|
: KWMailMergeDataSource( inst, parent )
|
|
|
|
: KWMailMergeDataSource( inst, parent )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_addressBook = KABC::StdAddressBook::self();
|
|
|
|
_addressBook = TDEABC::StdAddressBook::self();
|
|
|
|
_iterator = _addressBook->begin();
|
|
|
|
_iterator = _addressBook->begin();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// init record list
|
|
|
|
// init record list
|
|
|
|
// Using names from kaddressbook.
|
|
|
|
// Using names from kaddressbook.
|
|
|
|
sampleRecord[ ("KAddressbook identifier") ] = KABC::Addressee::uidLabel();
|
|
|
|
sampleRecord[ ("KAddressbook identifier") ] = TDEABC::Addressee::uidLabel();
|
|
|
|
sampleRecord[ ("Name" ) ] = KABC::Addressee::nameLabel();
|
|
|
|
sampleRecord[ ("Name" ) ] = TDEABC::Addressee::nameLabel();
|
|
|
|
sampleRecord[ ("Formatted name" ) ] = KABC::Addressee::formattedNameLabel();
|
|
|
|
sampleRecord[ ("Formatted name" ) ] = TDEABC::Addressee::formattedNameLabel();
|
|
|
|
sampleRecord[ ("Family names" ) ] = KABC::Addressee::familyNameLabel();
|
|
|
|
sampleRecord[ ("Family names" ) ] = TDEABC::Addressee::familyNameLabel();
|
|
|
|
sampleRecord[ ("Given name" ) ] = KABC::Addressee::givenNameLabel();
|
|
|
|
sampleRecord[ ("Given name" ) ] = TDEABC::Addressee::givenNameLabel();
|
|
|
|
sampleRecord[ ("Additional names" ) ] = KABC::Addressee::additionalNameLabel();
|
|
|
|
sampleRecord[ ("Additional names" ) ] = TDEABC::Addressee::additionalNameLabel();
|
|
|
|
sampleRecord[ ("Honorific prefixes" ) ] = KABC::Addressee::prefixLabel();
|
|
|
|
sampleRecord[ ("Honorific prefixes" ) ] = TDEABC::Addressee::prefixLabel();
|
|
|
|
sampleRecord[ ("Honorific suffixes" ) ] = KABC::Addressee::suffixLabel();
|
|
|
|
sampleRecord[ ("Honorific suffixes" ) ] = TDEABC::Addressee::suffixLabel();
|
|
|
|
sampleRecord[ ("Nick name" ) ] = KABC::Addressee::nickNameLabel();
|
|
|
|
sampleRecord[ ("Nick name" ) ] = TDEABC::Addressee::nickNameLabel();
|
|
|
|
sampleRecord[ ("Birthday" ) ] = KABC::Addressee::birthdayLabel();
|
|
|
|
sampleRecord[ ("Birthday" ) ] = TDEABC::Addressee::birthdayLabel();
|
|
|
|
sampleRecord[ ("Home address: Street" ) ] = KABC::Addressee::homeAddressStreetLabel();
|
|
|
|
sampleRecord[ ("Home address: Street" ) ] = TDEABC::Addressee::homeAddressStreetLabel();
|
|
|
|
sampleRecord[ ("Home address: Locality" ) ] = KABC::Addressee::homeAddressLocalityLabel();
|
|
|
|
sampleRecord[ ("Home address: Locality" ) ] = TDEABC::Addressee::homeAddressLocalityLabel();
|
|
|
|
sampleRecord[ ("Home address: Region" ) ] = KABC::Addressee::homeAddressRegionLabel();
|
|
|
|
sampleRecord[ ("Home address: Region" ) ] = TDEABC::Addressee::homeAddressRegionLabel();
|
|
|
|
sampleRecord[ ("Home address: Postal code" ) ] = KABC::Addressee::homeAddressPostalCodeLabel();
|
|
|
|
sampleRecord[ ("Home address: Postal code" ) ] = TDEABC::Addressee::homeAddressPostalCodeLabel();
|
|
|
|
sampleRecord[ ("Home address: Country" ) ] = KABC::Addressee::homeAddressCountryLabel();
|
|
|
|
sampleRecord[ ("Home address: Country" ) ] = TDEABC::Addressee::homeAddressCountryLabel();
|
|
|
|
sampleRecord[ ("Home address: Label" ) ] = KABC::Addressee::homeAddressLabelLabel();
|
|
|
|
sampleRecord[ ("Home address: Label" ) ] = TDEABC::Addressee::homeAddressLabelLabel();
|
|
|
|
sampleRecord[ ("Business address: Street" ) ] = KABC::Addressee::businessAddressStreetLabel();
|
|
|
|
sampleRecord[ ("Business address: Street" ) ] = TDEABC::Addressee::businessAddressStreetLabel();
|
|
|
|
sampleRecord[ ("Business address: Locality" ) ] = KABC::Addressee::businessAddressLocalityLabel();
|
|
|
|
sampleRecord[ ("Business address: Locality" ) ] = TDEABC::Addressee::businessAddressLocalityLabel();
|
|
|
|
sampleRecord[ ("Business address: Region" ) ] = KABC::Addressee::businessAddressRegionLabel();
|
|
|
|
sampleRecord[ ("Business address: Region" ) ] = TDEABC::Addressee::businessAddressRegionLabel();
|
|
|
|
sampleRecord[ ("Business address: Postal code" ) ] = KABC::Addressee::businessAddressPostalCodeLabel();
|
|
|
|
sampleRecord[ ("Business address: Postal code" ) ] = TDEABC::Addressee::businessAddressPostalCodeLabel();
|
|
|
|
sampleRecord[ ("Business address: Country" ) ] = KABC::Addressee::businessAddressCountryLabel();
|
|
|
|
sampleRecord[ ("Business address: Country" ) ] = TDEABC::Addressee::businessAddressCountryLabel();
|
|
|
|
sampleRecord[ ("Business address: Label" ) ] = KABC::Addressee::businessAddressLabelLabel();
|
|
|
|
sampleRecord[ ("Business address: Label" ) ] = TDEABC::Addressee::businessAddressLabelLabel();
|
|
|
|
sampleRecord[ ("Home phone" ) ] = KABC::Addressee::homePhoneLabel();
|
|
|
|
sampleRecord[ ("Home phone" ) ] = TDEABC::Addressee::homePhoneLabel();
|
|
|
|
sampleRecord[ ("Business phone" ) ] = KABC::Addressee::businessPhoneLabel();
|
|
|
|
sampleRecord[ ("Business phone" ) ] = TDEABC::Addressee::businessPhoneLabel();
|
|
|
|
sampleRecord[ ("Mobile phone" ) ] = KABC::Addressee::mobilePhoneLabel();
|
|
|
|
sampleRecord[ ("Mobile phone" ) ] = TDEABC::Addressee::mobilePhoneLabel();
|
|
|
|
sampleRecord[ ("Home fax" ) ] = KABC::Addressee::homeFaxLabel();
|
|
|
|
sampleRecord[ ("Home fax" ) ] = TDEABC::Addressee::homeFaxLabel();
|
|
|
|
sampleRecord[ ("Business fax" ) ] = KABC::Addressee::businessFaxLabel();
|
|
|
|
sampleRecord[ ("Business fax" ) ] = TDEABC::Addressee::businessFaxLabel();
|
|
|
|
sampleRecord[ ("Car phone" ) ] = KABC::Addressee::carPhoneLabel();
|
|
|
|
sampleRecord[ ("Car phone" ) ] = TDEABC::Addressee::carPhoneLabel();
|
|
|
|
sampleRecord[ ("ISDN" ) ] = KABC::Addressee::isdnLabel();
|
|
|
|
sampleRecord[ ("ISDN" ) ] = TDEABC::Addressee::isdnLabel();
|
|
|
|
sampleRecord[ ("Pager" ) ] = KABC::Addressee::pagerLabel();
|
|
|
|
sampleRecord[ ("Pager" ) ] = TDEABC::Addressee::pagerLabel();
|
|
|
|
sampleRecord[ ("Email" ) ] = KABC::Addressee::emailLabel();
|
|
|
|
sampleRecord[ ("Email" ) ] = TDEABC::Addressee::emailLabel();
|
|
|
|
sampleRecord[ ("Mailer" ) ] = KABC::Addressee::mailerLabel();
|
|
|
|
sampleRecord[ ("Mailer" ) ] = TDEABC::Addressee::mailerLabel();
|
|
|
|
sampleRecord[ ("Time zone" ) ] = KABC::Addressee::timeZoneLabel();
|
|
|
|
sampleRecord[ ("Time zone" ) ] = TDEABC::Addressee::timeZoneLabel();
|
|
|
|
sampleRecord[ ("Geographic position" ) ] = KABC::Addressee::geoLabel();
|
|
|
|
sampleRecord[ ("Geographic position" ) ] = TDEABC::Addressee::geoLabel();
|
|
|
|
sampleRecord[ ("Title" ) ] = KABC::Addressee::titleLabel();
|
|
|
|
sampleRecord[ ("Title" ) ] = TDEABC::Addressee::titleLabel();
|
|
|
|
sampleRecord[ ("Role" ) ] = KABC::Addressee::roleLabel();
|
|
|
|
sampleRecord[ ("Role" ) ] = TDEABC::Addressee::roleLabel();
|
|
|
|
sampleRecord[ ("Organization" ) ] = KABC::Addressee::organizationLabel();
|
|
|
|
sampleRecord[ ("Organization" ) ] = TDEABC::Addressee::organizationLabel();
|
|
|
|
sampleRecord[ ("Note" ) ] = KABC::Addressee::noteLabel();
|
|
|
|
sampleRecord[ ("Note" ) ] = TDEABC::Addressee::noteLabel();
|
|
|
|
sampleRecord[ ("productId" ) ] = KABC::Addressee::productIdLabel();
|
|
|
|
sampleRecord[ ("productId" ) ] = TDEABC::Addressee::productIdLabel();
|
|
|
|
sampleRecord[ ("Revision" ) ] = KABC::Addressee::revisionLabel();
|
|
|
|
sampleRecord[ ("Revision" ) ] = TDEABC::Addressee::revisionLabel();
|
|
|
|
sampleRecord[ ("sortString" ) ] = KABC::Addressee::sortStringLabel();
|
|
|
|
sampleRecord[ ("sortString" ) ] = TDEABC::Addressee::sortStringLabel();
|
|
|
|
sampleRecord[ ("URL" ) ] = KABC::Addressee::urlLabel();
|
|
|
|
sampleRecord[ ("URL" ) ] = TDEABC::Addressee::urlLabel();
|
|
|
|
sampleRecord[ ("Secrecy" ) ] = KABC::Addressee::secrecyLabel();
|
|
|
|
sampleRecord[ ("Secrecy" ) ] = TDEABC::Addressee::secrecyLabel();
|
|
|
|
sampleRecord[ ("Preferred address: Street" ) ] = TQString( "preferedAddressStreet" );
|
|
|
|
sampleRecord[ ("Preferred address: Street" ) ] = TQString( "preferedAddressStreet" );
|
|
|
|
sampleRecord[ ("Preferred address: Locality" ) ] = TQString( "preferedAddressLocality" );
|
|
|
|
sampleRecord[ ("Preferred address: Locality" ) ] = TQString( "preferedAddressLocality" );
|
|
|
|
sampleRecord[ ("Preferred address: Region" ) ] = TQString( "preferedAddressRegion" );
|
|
|
|
sampleRecord[ ("Preferred address: Region" ) ] = TQString( "preferedAddressRegion" );
|
|
|
@ -94,20 +94,20 @@ KWMailMergeKABC::KWMailMergeKABC( TDEInstance *inst, TQObject *parent )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
KWMailMergeKABC::~KWMailMergeKABC()
|
|
|
|
KWMailMergeTDEABC::~KWMailMergeKABC()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
;
|
|
|
|
;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KWMailMergeKABC::addEntry( const TQString &uid )
|
|
|
|
void KWMailMergeTDEABC::addEntry( const TQString &uid )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_individualUIDs.append( uid );
|
|
|
|
_individualUIDs.append( uid );
|
|
|
|
makeUIDsExclusive();
|
|
|
|
makeUIDsExclusive();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KWMailMergeKABC::addList( const TQString &id )
|
|
|
|
void KWMailMergeTDEABC::addList( const TQString &id )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_lists.append( id );
|
|
|
|
_lists.append( id );
|
|
|
|
parseList( id );
|
|
|
|
parseList( id );
|
|
|
@ -115,7 +115,7 @@ void KWMailMergeKABC::addList( const TQString &id )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KWMailMergeKABC::clear()
|
|
|
|
void KWMailMergeTDEABC::clear()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_exclusiveUIDs.clear();
|
|
|
|
_exclusiveUIDs.clear();
|
|
|
|
_individualUIDs.clear();
|
|
|
|
_individualUIDs.clear();
|
|
|
@ -124,16 +124,16 @@ void KWMailMergeKABC::clear()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int KWMailMergeKABC::getNumRecords() const
|
|
|
|
int KWMailMergeTDEABC::getNumRecords() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdDebug() << "KWMailMergeKABC::getNumRecords(): " << _exclusiveUIDs.count() << endl;
|
|
|
|
kdDebug() << "KWMailMergeTDEABC::getNumRecords(): " << _exclusiveUIDs.count() << endl;
|
|
|
|
return _exclusiveUIDs.count();
|
|
|
|
return _exclusiveUIDs.count();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQString KWMailMergeKABC::getValue( const TQString &name, int record ) const
|
|
|
|
TQString KWMailMergeTDEABC::getValue( const TQString &name, int record ) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdDebug() << "KWMailMergeKABC::getValue(" << name << ", " << record << ")" << endl;
|
|
|
|
kdDebug() << "KWMailMergeTDEABC::getValue(" << name << ", " << record << ")" << endl;
|
|
|
|
if ( record < 0 )
|
|
|
|
if ( record < 0 )
|
|
|
|
return name;
|
|
|
|
return name;
|
|
|
|
|
|
|
|
|
|
|
@ -172,7 +172,7 @@ TQString KWMailMergeKABC::getValue( const TQString &name, int record ) const
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
KABC::Addressee addr = *_iterator;
|
|
|
|
TDEABC::Addressee addr = *_iterator;
|
|
|
|
_iterator++; // Don't know why. Could be removed? Dirk Schmidt
|
|
|
|
_iterator++; // Don't know why. Could be removed? Dirk Schmidt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -202,136 +202,136 @@ TQString KWMailMergeKABC::getValue( const TQString &name, int record ) const
|
|
|
|
|
|
|
|
|
|
|
|
if ( name == "Home address: Street" )
|
|
|
|
if ( name == "Home address: Street" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Address a = addr.address( KABC::Address::Home );
|
|
|
|
TDEABC::Address a = addr.address( TDEABC::Address::Home );
|
|
|
|
return a.street();
|
|
|
|
return a.street();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Home address: Locality" )
|
|
|
|
if ( name == "Home address: Locality" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Address a = addr.address( KABC::Address::Home );
|
|
|
|
TDEABC::Address a = addr.address( TDEABC::Address::Home );
|
|
|
|
return a.locality();
|
|
|
|
return a.locality();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Home address: Region" )
|
|
|
|
if ( name == "Home address: Region" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Address a = addr.address( KABC::Address::Home );
|
|
|
|
TDEABC::Address a = addr.address( TDEABC::Address::Home );
|
|
|
|
return a.region();
|
|
|
|
return a.region();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Home address: Postal code" )
|
|
|
|
if ( name == "Home address: Postal code" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Address a = addr.address( KABC::Address::Home );
|
|
|
|
TDEABC::Address a = addr.address( TDEABC::Address::Home );
|
|
|
|
return a.postalCode();
|
|
|
|
return a.postalCode();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Home address: Country" )
|
|
|
|
if ( name == "Home address: Country" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Address a = addr.address( KABC::Address::Home );
|
|
|
|
TDEABC::Address a = addr.address( TDEABC::Address::Home );
|
|
|
|
return a.country();
|
|
|
|
return a.country();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Home address: Label" )
|
|
|
|
if ( name == "Home address: Label" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Address a = addr.address( KABC::Address::Home );
|
|
|
|
TDEABC::Address a = addr.address( TDEABC::Address::Home );
|
|
|
|
return a.label();
|
|
|
|
return a.label();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( name == "Business address: Street" )
|
|
|
|
if ( name == "Business address: Street" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Address a = addr.address( KABC::Address::Work );
|
|
|
|
TDEABC::Address a = addr.address( TDEABC::Address::Work );
|
|
|
|
return a.street();
|
|
|
|
return a.street();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Business address: Locality" )
|
|
|
|
if ( name == "Business address: Locality" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Address a = addr.address( KABC::Address::Work );
|
|
|
|
TDEABC::Address a = addr.address( TDEABC::Address::Work );
|
|
|
|
return a.locality();
|
|
|
|
return a.locality();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Business address: Region" )
|
|
|
|
if ( name == "Business address: Region" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Address a = addr.address( KABC::Address::Work );
|
|
|
|
TDEABC::Address a = addr.address( TDEABC::Address::Work );
|
|
|
|
return a.region();
|
|
|
|
return a.region();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Business address: Postal code" )
|
|
|
|
if ( name == "Business address: Postal code" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Address a = addr.address( KABC::Address::Work );
|
|
|
|
TDEABC::Address a = addr.address( TDEABC::Address::Work );
|
|
|
|
return a.postalCode();
|
|
|
|
return a.postalCode();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Business address: Country" )
|
|
|
|
if ( name == "Business address: Country" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Address a = addr.address( KABC::Address::Work );
|
|
|
|
TDEABC::Address a = addr.address( TDEABC::Address::Work );
|
|
|
|
return a.country();
|
|
|
|
return a.country();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Business address: Label" )
|
|
|
|
if ( name == "Business address: Label" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Address a = addr.address( KABC::Address::Work );
|
|
|
|
TDEABC::Address a = addr.address( TDEABC::Address::Work );
|
|
|
|
return a.label();
|
|
|
|
return a.label();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( name == "Prefered address: Street" )
|
|
|
|
if ( name == "Prefered address: Street" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Address a = addr.address( KABC::Address::Pref );
|
|
|
|
TDEABC::Address a = addr.address( TDEABC::Address::Pref );
|
|
|
|
return a.street();
|
|
|
|
return a.street();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( name == "Prefered address: Locality" )
|
|
|
|
if ( name == "Prefered address: Locality" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Address a = addr.address( KABC::Address::Pref );
|
|
|
|
TDEABC::Address a = addr.address( TDEABC::Address::Pref );
|
|
|
|
return a.locality();
|
|
|
|
return a.locality();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Prefered address: Region" )
|
|
|
|
if ( name == "Prefered address: Region" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Address a = addr.address( KABC::Address::Pref );
|
|
|
|
TDEABC::Address a = addr.address( TDEABC::Address::Pref );
|
|
|
|
return a.region();
|
|
|
|
return a.region();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Prefered address: Postal code" )
|
|
|
|
if ( name == "Prefered address: Postal code" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Address a = addr.address( KABC::Address::Pref );
|
|
|
|
TDEABC::Address a = addr.address( TDEABC::Address::Pref );
|
|
|
|
return a.postalCode();
|
|
|
|
return a.postalCode();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Prefered address: Country" )
|
|
|
|
if ( name == "Prefered address: Country" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Address a = addr.address( KABC::Address::Pref );
|
|
|
|
TDEABC::Address a = addr.address( TDEABC::Address::Pref );
|
|
|
|
return a.country();
|
|
|
|
return a.country();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Prefered address: Label" )
|
|
|
|
if ( name == "Prefered address: Label" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Address a = addr.address( KABC::Address::Pref );
|
|
|
|
TDEABC::Address a = addr.address( TDEABC::Address::Pref );
|
|
|
|
return a.label();
|
|
|
|
return a.label();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( name == "Home phone" )
|
|
|
|
if ( name == "Home phone" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::PhoneNumber phone = addr.phoneNumber( KABC::PhoneNumber::Home );
|
|
|
|
TDEABC::PhoneNumber phone = addr.phoneNumber( TDEABC::PhoneNumber::Home );
|
|
|
|
return phone.number();
|
|
|
|
return phone.number();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Business phone" )
|
|
|
|
if ( name == "Business phone" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::PhoneNumber phone = addr.phoneNumber( KABC::PhoneNumber::Work );
|
|
|
|
TDEABC::PhoneNumber phone = addr.phoneNumber( TDEABC::PhoneNumber::Work );
|
|
|
|
return phone.number();
|
|
|
|
return phone.number();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Mobile phone" )
|
|
|
|
if ( name == "Mobile phone" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::PhoneNumber phone = addr.phoneNumber( KABC::PhoneNumber::Cell );
|
|
|
|
TDEABC::PhoneNumber phone = addr.phoneNumber( TDEABC::PhoneNumber::Cell );
|
|
|
|
return phone.number();
|
|
|
|
return phone.number();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Home fax" )
|
|
|
|
if ( name == "Home fax" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::PhoneNumber phone = addr.phoneNumber( KABC::PhoneNumber::Home | KABC::PhoneNumber::Fax );
|
|
|
|
TDEABC::PhoneNumber phone = addr.phoneNumber( TDEABC::PhoneNumber::Home | TDEABC::PhoneNumber::Fax );
|
|
|
|
return phone.number();
|
|
|
|
return phone.number();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Business fax" )
|
|
|
|
if ( name == "Business fax" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::PhoneNumber phone = addr.phoneNumber( KABC::PhoneNumber::Work | KABC::PhoneNumber::Fax );
|
|
|
|
TDEABC::PhoneNumber phone = addr.phoneNumber( TDEABC::PhoneNumber::Work | TDEABC::PhoneNumber::Fax );
|
|
|
|
return phone.number();
|
|
|
|
return phone.number();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Car phone" )
|
|
|
|
if ( name == "Car phone" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::PhoneNumber phone = addr.phoneNumber( KABC::PhoneNumber::Car );
|
|
|
|
TDEABC::PhoneNumber phone = addr.phoneNumber( TDEABC::PhoneNumber::Car );
|
|
|
|
return phone.number();
|
|
|
|
return phone.number();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "ISDN" )
|
|
|
|
if ( name == "ISDN" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::PhoneNumber phone = addr.phoneNumber( KABC::PhoneNumber::Isdn );
|
|
|
|
TDEABC::PhoneNumber phone = addr.phoneNumber( TDEABC::PhoneNumber::Isdn );
|
|
|
|
return phone.number();
|
|
|
|
return phone.number();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Pager" )
|
|
|
|
if ( name == "Pager" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::PhoneNumber phone = addr.phoneNumber( KABC::PhoneNumber::Pager );
|
|
|
|
TDEABC::PhoneNumber phone = addr.phoneNumber( TDEABC::PhoneNumber::Pager );
|
|
|
|
return phone.number();
|
|
|
|
return phone.number();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -341,12 +341,12 @@ TQString KWMailMergeKABC::getValue( const TQString &name, int record ) const
|
|
|
|
return addr.mailer();
|
|
|
|
return addr.mailer();
|
|
|
|
if ( name == "Time zone" )
|
|
|
|
if ( name == "Time zone" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::TimeZone zone = addr.timeZone();
|
|
|
|
TDEABC::TimeZone zone = addr.timeZone();
|
|
|
|
return TQString::number( zone.offset() );
|
|
|
|
return TQString::number( zone.offset() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( name == "Geographic position" )
|
|
|
|
if ( name == "Geographic position" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Geo geo = addr.geo();
|
|
|
|
TDEABC::Geo geo = addr.geo();
|
|
|
|
TQString lat;
|
|
|
|
TQString lat;
|
|
|
|
TQString longi;
|
|
|
|
TQString longi;
|
|
|
|
if( geo.latitude()<0 )
|
|
|
|
if( geo.latitude()<0 )
|
|
|
@ -382,21 +382,21 @@ TQString KWMailMergeKABC::getValue( const TQString &name, int record ) const
|
|
|
|
return addr.url().url();
|
|
|
|
return addr.url().url();
|
|
|
|
if ( name == "Secrecy" )
|
|
|
|
if ( name == "Secrecy" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KABC::Secrecy secrecy = addr.secrecy();
|
|
|
|
TDEABC::Secrecy secrecy = addr.secrecy();
|
|
|
|
return KABC::Secrecy::typeLabel( secrecy.type() );
|
|
|
|
return TDEABC::Secrecy::typeLabel( secrecy.type() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return ( i18n("Unkown mail merge variable: %1").arg ( name ) ) ;
|
|
|
|
return ( i18n("Unkown mail merge variable: %1").arg ( name ) ) ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQStringList KWMailMergeKABC::lists() const
|
|
|
|
TQStringList KWMailMergeTDEABC::lists() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return _lists;
|
|
|
|
return _lists;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KWMailMergeKABC::load( TQDomElement& parentElem )
|
|
|
|
void KWMailMergeTDEABC::load( TQDomElement& parentElem )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
clear();
|
|
|
|
clear();
|
|
|
|
TQDomNode contentNode=parentElem.namedItem("CONTENT");
|
|
|
|
TQDomNode contentNode=parentElem.namedItem("CONTENT");
|
|
|
@ -426,11 +426,11 @@ void KWMailMergeKABC::load( TQDomElement& parentElem )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KWMailMergeKABC::makeUIDsExclusive()
|
|
|
|
void KWMailMergeTDEABC::makeUIDsExclusive()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_exclusiveUIDs = _individualUIDs + _listUIDs;
|
|
|
|
_exclusiveUIDs = _individualUIDs + _listUIDs;
|
|
|
|
_exclusiveUIDs.sort();
|
|
|
|
_exclusiveUIDs.sort();
|
|
|
|
kdDebug() << "KWMailMergeKABC::makeUIDsExclusive(): before: " << _exclusiveUIDs.join(",")
|
|
|
|
kdDebug() << "KWMailMergeTDEABC::makeUIDsExclusive(): before: " << _exclusiveUIDs.join(",")
|
|
|
|
<< endl;
|
|
|
|
<< endl;
|
|
|
|
TQString uid;
|
|
|
|
TQString uid;
|
|
|
|
for( TQStringList::Iterator it=_exclusiveUIDs.begin();
|
|
|
|
for( TQStringList::Iterator it=_exclusiveUIDs.begin();
|
|
|
@ -442,45 +442,45 @@ void KWMailMergeKABC::makeUIDsExclusive()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
uid = *it;
|
|
|
|
uid = *it;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
kdDebug() << "KWMailMergeKABC::makeUIDsExclusive(): after: " << _exclusiveUIDs.join(",")
|
|
|
|
kdDebug() << "KWMailMergeTDEABC::makeUIDsExclusive(): after: " << _exclusiveUIDs.join(",")
|
|
|
|
<< endl;
|
|
|
|
<< endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KWMailMergeKABC::parseList( const TQString& listName )
|
|
|
|
void KWMailMergeTDEABC::parseList( const TQString& listName )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if( listName.isEmpty() )
|
|
|
|
if( listName.isEmpty() )
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
kdDebug() << "KWMailMergeKABC::parseList: " << listName << endl;
|
|
|
|
kdDebug() << "KWMailMergeTDEABC::parseList: " << listName << endl;
|
|
|
|
KABC::DistributionListManager dlm ( _addressBook );
|
|
|
|
TDEABC::DistributionListManager dlm ( _addressBook );
|
|
|
|
dlm.load();
|
|
|
|
dlm.load();
|
|
|
|
|
|
|
|
|
|
|
|
TQStringList::Iterator listIt;
|
|
|
|
TQStringList::Iterator listIt;
|
|
|
|
|
|
|
|
|
|
|
|
KABC::DistributionList* list = dlm.list( listName );
|
|
|
|
TDEABC::DistributionList* list = dlm.list( listName );
|
|
|
|
KABC::DistributionList::Entry::List entries = list->entries();
|
|
|
|
TDEABC::DistributionList::Entry::List entries = list->entries();
|
|
|
|
|
|
|
|
|
|
|
|
KABC::DistributionList::Entry::List::Iterator itemIt;
|
|
|
|
TDEABC::DistributionList::Entry::List::Iterator itemIt;
|
|
|
|
for ( itemIt = entries.begin(); itemIt != entries.end(); ++itemIt )
|
|
|
|
for ( itemIt = entries.begin(); itemIt != entries.end(); ++itemIt )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdDebug() << "WMailMergeKABC::parseList: Listentry UID: " <<
|
|
|
|
kdDebug() << "WMailMergeTDEABC::parseList: Listentry UID: " <<
|
|
|
|
(*itemIt).addressee.uid() << endl;
|
|
|
|
(*itemIt).addressee.uid() << endl;
|
|
|
|
_listUIDs.append( (*itemIt).addressee.uid() );
|
|
|
|
_listUIDs.append( (*itemIt).addressee.uid() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KWMailMergeKABC::refresh( bool )
|
|
|
|
void KWMailMergeTDEABC::refresh( bool )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdDebug() << "KWMailMergeKABC::refresh()" << endl;
|
|
|
|
kdDebug() << "KWMailMergeTDEABC::refresh()" << endl;
|
|
|
|
_iterator = _addressBook->begin();
|
|
|
|
_iterator = _addressBook->begin();
|
|
|
|
_UIDIterator = _individualUIDs.begin();
|
|
|
|
_UIDIterator = _individualUIDs.begin();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KWMailMergeKABC::save( TQDomDocument& doc, TQDomElement& parent)
|
|
|
|
void KWMailMergeTDEABC::save( TQDomDocument& doc, TQDomElement& parent)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQDomElement cont=doc.createElement(TQString::fromLatin1("CONTENT"));
|
|
|
|
TQDomElement cont=doc.createElement(TQString::fromLatin1("CONTENT"));
|
|
|
|
parent.appendChild(cont);
|
|
|
|
parent.appendChild(cont);
|
|
|
@ -506,7 +506,7 @@ void KWMailMergeKABC::save( TQDomDocument& doc, TQDomElement& parent)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool KWMailMergeKABC::showConfigDialog( TQWidget* par, int action )
|
|
|
|
bool KWMailMergeTDEABC::showConfigDialog( TQWidget* par, int action )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool ret=false;
|
|
|
|
bool ret=false;
|
|
|
|
if (action == KWSLCreate )
|
|
|
|
if (action == KWSLCreate )
|
|
|
@ -528,7 +528,7 @@ bool KWMailMergeKABC::showConfigDialog( TQWidget* par, int action )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQStringList KWMailMergeKABC::singleRecords() const
|
|
|
|
TQStringList KWMailMergeTDEABC::singleRecords() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return _individualUIDs;
|
|
|
|
return _individualUIDs;
|
|
|
|
}
|
|
|
|
}
|
|
|
|