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