diff options
author | Slávek Banko <[email protected]> | 2013-09-03 19:57:37 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2013-09-03 19:57:37 +0200 |
commit | 15ae7be824e362e8397532d7d60a3a93055caa41 (patch) | |
tree | 335b1112358991072b87137eb5ae8aa384b57c63 /kword/mailmerge/tdeabc | |
parent | 13402815bec5cb5702aedbd0a8119e40f106c2c1 (diff) | |
download | koffice-15ae7be824e362e8397532d7d60a3a93055caa41.tar.gz koffice-15ae7be824e362e8397532d7d60a3a93055caa41.zip |
Additional k => tde renaming and fixes
Diffstat (limited to 'kword/mailmerge/tdeabc')
-rw-r--r-- | kword/mailmerge/tdeabc/KWMailMergeTDEABC.cpp | 551 | ||||
-rw-r--r-- | kword/mailmerge/tdeabc/KWMailMergeTDEABC.h | 186 | ||||
-rw-r--r-- | kword/mailmerge/tdeabc/KWMailMergeTDEABCConfig.cpp | 546 | ||||
-rw-r--r-- | kword/mailmerge/tdeabc/KWMailMergeTDEABCConfig.h | 150 | ||||
-rw-r--r-- | kword/mailmerge/tdeabc/Makefile.am | 17 | ||||
-rw-r--r-- | kword/mailmerge/tdeabc/addresspicker.ui | 297 | ||||
-rw-r--r-- | kword/mailmerge/tdeabc/kwmailmerge_tdeabc.desktop | 105 |
7 files changed, 1852 insertions, 0 deletions
diff --git a/kword/mailmerge/tdeabc/KWMailMergeTDEABC.cpp b/kword/mailmerge/tdeabc/KWMailMergeTDEABC.cpp new file mode 100644 index 00000000..2be13003 --- /dev/null +++ b/kword/mailmerge/tdeabc/KWMailMergeTDEABC.cpp @@ -0,0 +1,551 @@ +/* + This file is part of the KDE project + Copyright (C) 2003 Tobias Koenig <[email protected]> + Joseph Wenninger <[email protected]> + Ingo Kloecker <[email protected]> + Copyright (C) 2004 Tobias Koenig <[email protected]> + Joseph Wenninger <[email protected]> + Ingo Kloecker <[email protected]> + Dirk Schmidt <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. +*/ + +#include <kdebug.h> +#include <tdeglobal.h> +#include <tdelocale.h> +#include <tdeabc/distributionlist.h> +#include <tdeabc/stdaddressbook.h> + +#include "KWMailMergeTDEABC.h" +#include "KWMailMergeTDEABCConfig.h" + +KWMailMergeTDEABC::KWMailMergeTDEABC( TDEInstance *inst, TQObject *parent ) + : KWMailMergeDataSource( inst, parent ) +{ + _addressBook = TDEABC::StdAddressBook::self(); + _iterator = _addressBook->begin(); + + + // init record list + // Using names from kaddressbook. + 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" ); + sampleRecord[ ("Preferred address: Postal code" ) ] = TQString( "preferedAddressPostalCode" ); + sampleRecord[ ("Preferred address: Country" ) ] = TQString( "preferedAddressCountry" ); + sampleRecord[ ("Preferred address: Label" ) ] = TQString( "preferedAddressLabel" ); +} + + +KWMailMergeTDEABC::~KWMailMergeTDEABC() +{ + ; +} + + +void KWMailMergeTDEABC::addEntry( const TQString &uid ) +{ + _individualUIDs.append( uid ); + makeUIDsExclusive(); +} + + +void KWMailMergeTDEABC::addList( const TQString &id ) +{ + _lists.append( id ); + parseList( id ); + makeUIDsExclusive(); +} + + +void KWMailMergeTDEABC::clear() +{ + _exclusiveUIDs.clear(); + _individualUIDs.clear(); + _listUIDs.clear(); + _lists.clear(); +} + + +int KWMailMergeTDEABC::getNumRecords() const +{ + kdDebug() << "KWMailMergeTDEABC::getNumRecords(): " << _exclusiveUIDs.count() << endl; + return _exclusiveUIDs.count(); +} + + +TQString KWMailMergeTDEABC::getValue( const TQString &name, int record ) const +{ + kdDebug() << "KWMailMergeTDEABC::getValue(" << name << ", " << record << ")" << endl; + if ( record < 0 ) + return name; + + // This doesn't ever happen, right? So why is it there? Dirk Schmidt + if ( record == -1 && _iterator == _addressBook->end() ) + return ""; + + // + // Set the iterator to the asked Addressee. + // + bool uidAvailable = false; + if ( record != -1 ) + { + int counter = 0; + + for ( _UIDIterator = _exclusiveUIDs.begin(); _UIDIterator != _exclusiveUIDs.end() + && counter < record; _UIDIterator++ ) + { + counter++; + } + + for ( _iterator = _addressBook->begin(); _iterator != _addressBook->end(); ++_iterator ) + { + + if( _iterator->uid() == *_UIDIterator ) + { + uidAvailable = true; + break; + } + } + } + + if( !uidAvailable ) + { + return ( i18n ( "KAddressbook entry '%1' not available." ).arg( *_UIDIterator ) ); + } + + + TDEABC::Addressee addr = *_iterator; + _iterator++; // Don't know why. Could be removed? Dirk Schmidt + + + // + // Return the asked variable. + // + if ( name == "KAddressbook identifier" ) + return addr.uid(); + if ( name == "Name" ) + return addr.name(); + if ( name == "Formatted name" ) + return addr.formattedName(); + if ( name == "Family names" ) + return addr.familyName(); + if ( name == "Given name" ) + return addr.givenName(); + if ( name == "Additional names" ) + return addr.additionalName(); + if ( name == "Honorific prefixes" ) + return addr.prefix(); + if ( name == "Honorific suffixes" ) + return addr.suffix(); + if ( name == "Nick name" ) + return addr.nickName(); + if ( name == "Birthday" ) + return TDEGlobal::locale()->formatDate( addr.birthday().date() ); + + if ( name == "Home address: Street" ) + { + TDEABC::Address a = addr.address( TDEABC::Address::Home ); + return a.street(); + } + if ( name == "Home address: Locality" ) + { + TDEABC::Address a = addr.address( TDEABC::Address::Home ); + return a.locality(); + } + if ( name == "Home address: Region" ) + { + TDEABC::Address a = addr.address( TDEABC::Address::Home ); + return a.region(); + } + if ( name == "Home address: Postal code" ) + { + TDEABC::Address a = addr.address( TDEABC::Address::Home ); + return a.postalCode(); + } + if ( name == "Home address: Country" ) + { + TDEABC::Address a = addr.address( TDEABC::Address::Home ); + return a.country(); + } + if ( name == "Home address: Label" ) + { + TDEABC::Address a = addr.address( TDEABC::Address::Home ); + return a.label(); + } + + if ( name == "Business address: Street" ) + { + TDEABC::Address a = addr.address( TDEABC::Address::Work ); + return a.street(); + } + if ( name == "Business address: Locality" ) + { + TDEABC::Address a = addr.address( TDEABC::Address::Work ); + return a.locality(); + } + if ( name == "Business address: Region" ) + { + TDEABC::Address a = addr.address( TDEABC::Address::Work ); + return a.region(); + } + if ( name == "Business address: Postal code" ) + { + TDEABC::Address a = addr.address( TDEABC::Address::Work ); + return a.postalCode(); + } + if ( name == "Business address: Country" ) + { + TDEABC::Address a = addr.address( TDEABC::Address::Work ); + return a.country(); + } + if ( name == "Business address: Label" ) + { + TDEABC::Address a = addr.address( TDEABC::Address::Work ); + return a.label(); + } + + if ( name == "Prefered address: Street" ) + { + TDEABC::Address a = addr.address( TDEABC::Address::Pref ); + return a.street(); + } + + if ( name == "Prefered address: Locality" ) + { + TDEABC::Address a = addr.address( TDEABC::Address::Pref ); + return a.locality(); + } + if ( name == "Prefered address: Region" ) + { + TDEABC::Address a = addr.address( TDEABC::Address::Pref ); + return a.region(); + } + if ( name == "Prefered address: Postal code" ) + { + TDEABC::Address a = addr.address( TDEABC::Address::Pref ); + return a.postalCode(); + } + if ( name == "Prefered address: Country" ) + { + TDEABC::Address a = addr.address( TDEABC::Address::Pref ); + return a.country(); + } + if ( name == "Prefered address: Label" ) + { + TDEABC::Address a = addr.address( TDEABC::Address::Pref ); + return a.label(); + } + + if ( name == "Home phone" ) + { + TDEABC::PhoneNumber phone = addr.phoneNumber( TDEABC::PhoneNumber::Home ); + return phone.number(); + } + if ( name == "Business phone" ) + { + TDEABC::PhoneNumber phone = addr.phoneNumber( TDEABC::PhoneNumber::Work ); + return phone.number(); + } + if ( name == "Mobile phone" ) + { + TDEABC::PhoneNumber phone = addr.phoneNumber( TDEABC::PhoneNumber::Cell ); + return phone.number(); + } + if ( name == "Home fax" ) + { + TDEABC::PhoneNumber phone = addr.phoneNumber( TDEABC::PhoneNumber::Home | TDEABC::PhoneNumber::Fax ); + return phone.number(); + } + if ( name == "Business fax" ) + { + TDEABC::PhoneNumber phone = addr.phoneNumber( TDEABC::PhoneNumber::Work | TDEABC::PhoneNumber::Fax ); + return phone.number(); + } + if ( name == "Car phone" ) + { + TDEABC::PhoneNumber phone = addr.phoneNumber( TDEABC::PhoneNumber::Car ); + return phone.number(); + } + if ( name == "ISDN" ) + { + TDEABC::PhoneNumber phone = addr.phoneNumber( TDEABC::PhoneNumber::Isdn ); + return phone.number(); + } + if ( name == "Pager" ) + { + TDEABC::PhoneNumber phone = addr.phoneNumber( TDEABC::PhoneNumber::Pager ); + return phone.number(); + } + + if ( name == "Email" ) + return addr.preferredEmail(); + if ( name == "Mailer" ) + return addr.mailer(); + if ( name == "Time zone" ) + { + TDEABC::TimeZone zone = addr.timeZone(); + return TQString::number( zone.offset() ); + } + if ( name == "Geographic position" ) + { + TDEABC::Geo geo = addr.geo(); + TQString lat; + TQString longi; + if( geo.latitude()<0 ) + lat = TQString( i18n("%1 South") ).arg( -geo.latitude() ); + else + lat = TQString( i18n("%1 North") ).arg( geo.latitude() ); + + if( geo.longitude()<0 ) + // There is something going wrong, because "W" is replaced by "q ". + // Needs fix. + longi = TQString( i18n("%1 West") ).arg( -geo.longitude() ); + else + longi = TQString( i18n("%1 East") ).arg( geo.longitude() ); + + return i18n( "Geographic coordinates", "%1, %2" ).arg ( lat, longi ); + } + + if ( name == "Title" ) + return addr.title(); + if ( name == "Role" ) + return addr.role(); + if ( name == "Organization" ) + return addr.organization(); + if ( name == "Note" ) + return addr.note(); + if ( name == "productId" ) + return addr.productId(); + if ( name == "Revision" ) + return TDEGlobal::locale()->formatDate( addr.revision().date() ); + if ( name == "sortString" ) + return addr.sortString(); + if ( name == "URL" ) + return addr.url().url(); + if ( name == "Secrecy" ) + { + TDEABC::Secrecy secrecy = addr.secrecy(); + return TDEABC::Secrecy::typeLabel( secrecy.type() ); + } + + return ( i18n("Unkown mail merge variable: %1").arg ( name ) ) ; +} + + +TQStringList KWMailMergeTDEABC::lists() const +{ + return _lists; +} + + +void KWMailMergeTDEABC::load( TQDomElement& parentElem ) +{ + clear(); + TQDomNode contentNode=parentElem.namedItem("CONTENT"); + if( contentNode.isNull() ) + return; + for( TQDomNode rec=contentNode.firstChild(); !rec.isNull(); rec=rec.nextSibling() ) + { + if( rec.nodeName()== "RECORD" ) + { + for( TQDomElement recEnt=rec.firstChild().toElement(); !recEnt.isNull(); + recEnt=recEnt.nextSibling().toElement() ) + { + addEntry( recEnt.attribute( TQString::fromLatin1("uid") ) ); + } + } + else if( rec.nodeName() == "LIST" ) + { + for( TQDomElement recEnt=rec.firstChild().toElement(); !recEnt.isNull(); + recEnt=recEnt.nextSibling().toElement() ) + { + addList( recEnt.attribute( TQString::fromLatin1("listid") ) ); + } + } + else + kdDebug() << "rec.nodeName(): " << rec.nodeName() << endl; + } +} + + +void KWMailMergeTDEABC::makeUIDsExclusive() +{ + _exclusiveUIDs = _individualUIDs + _listUIDs; + _exclusiveUIDs.sort(); + kdDebug() << "KWMailMergeTDEABC::makeUIDsExclusive(): before: " << _exclusiveUIDs.join(",") + << endl; + TQString uid; + for( TQStringList::Iterator it=_exclusiveUIDs.begin(); + it!=_exclusiveUIDs.end(); ++it ) + { + if( *it == uid ) + { + it = _exclusiveUIDs.remove( it ); + } + uid = *it; + } + kdDebug() << "KWMailMergeTDEABC::makeUIDsExclusive(): after: " << _exclusiveUIDs.join(",") + << endl; +} + + +void KWMailMergeTDEABC::parseList( const TQString& listName ) +{ + if( listName.isEmpty() ) + return; + + kdDebug() << "KWMailMergeTDEABC::parseList: " << listName << endl; + TDEABC::DistributionListManager dlm ( _addressBook ); + dlm.load(); + + TQStringList::Iterator listIt; + + TDEABC::DistributionList* list = dlm.list( listName ); + TDEABC::DistributionList::Entry::List entries = list->entries(); + + TDEABC::DistributionList::Entry::List::Iterator itemIt; + for ( itemIt = entries.begin(); itemIt != entries.end(); ++itemIt ) + { + kdDebug() << "WMailMergeTDEABC::parseList: Listentry UID: " << + (*itemIt).addressee.uid() << endl; + _listUIDs.append( (*itemIt).addressee.uid() ); + } +} + + +void KWMailMergeTDEABC::refresh( bool ) +{ + kdDebug() << "KWMailMergeTDEABC::refresh()" << endl; + _iterator = _addressBook->begin(); + _UIDIterator = _individualUIDs.begin(); + +} + + +void KWMailMergeTDEABC::save( TQDomDocument& doc, TQDomElement& parent) +{ + TQDomElement cont=doc.createElement(TQString::fromLatin1("CONTENT")); + parent.appendChild(cont); + + TQValueList<TQString>::ConstIterator it = _individualUIDs.begin(); + for( ; it != _individualUIDs.end(); ++it ) + { + TQDomElement rec=doc.createElement(TQString::fromLatin1("RECORD")); + cont.appendChild(rec); + TQDomElement recEnt=doc.createElement(TQString::fromLatin1("ITEM")); + recEnt.setAttribute(TQString::fromLatin1("uid"),*it); + rec.appendChild(recEnt); + } + + it = _lists.begin(); + for( ; !(it == _lists.end()); ++it ) + { + TQDomElement rec=doc.createElement(TQString::fromLatin1("LIST")); + cont.appendChild(rec); + TQDomElement recEnt=doc.createElement(TQString::fromLatin1("ITEM")); + recEnt.setAttribute(TQString::fromLatin1("listid"),*it); + rec.appendChild(recEnt); + } +} + +bool KWMailMergeTDEABC::showConfigDialog( TQWidget* par, int action ) +{ + bool ret=false; + if (action == KWSLCreate ) + { + clear(); + } + + //if (action==KWSLOpen) + { + KWMailMergeTDEABCConfig *dia=new KWMailMergeTDEABCConfig( par, this ); + + ret=( dia->exec() == TQDialog::Accepted ); + kdDebug() << "KWMailMergeTDEABCConfig::Accepted " << ret << endl; + delete dia; + } + refresh(false); + + return ret; +} + + +TQStringList KWMailMergeTDEABC::singleRecords() const +{ + return _individualUIDs; +} + + + +extern "C" +{ + KWORD_MAILMERGE_EXPORT KWMailMergeDataSource *create_kwmailmerge_tdeabc( TDEInstance *inst, TQObject *parent ) + { + return new KWMailMergeTDEABC( inst, parent ); + } +} + + + + +#include "KWMailMergeTDEABC.moc" + + diff --git a/kword/mailmerge/tdeabc/KWMailMergeTDEABC.h b/kword/mailmerge/tdeabc/KWMailMergeTDEABC.h new file mode 100644 index 00000000..3db02d91 --- /dev/null +++ b/kword/mailmerge/tdeabc/KWMailMergeTDEABC.h @@ -0,0 +1,186 @@ +/* + This file is part of the KDE project + Copyright (C) 2003 Tobias Koenig <[email protected]> + Copyright (C) 2004 Tobias Koenig <[email protected]> + Dirk Schmidt <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. +*/ + +#ifndef _KWMAILMERGE_KABC_H_ +#define _KWMAILMERGE_KABC_H_ + +#include <tqdom.h> +#include <tqguardedptr.h> + +#include <tdeabc/addressbook.h> + +#include "KWMailMergeDataSource.h" + +class KWMailMergeTDEABC: public KWMailMergeDataSource +{ + Q_OBJECT + + +public: + KWMailMergeTDEABC( TDEInstance *inst, TQObject *parent ); + ~KWMailMergeTDEABC(); + + /** + Saves the mail merge list to the kword document. + */ + virtual void save( TQDomDocument&, TQDomElement& ); + + /** + Loads the mail merge list stored in the kword document. + */ + virtual void load( TQDomElement& ); + + /** + @param name The name of the value e.g. "Family name". + @param record The position of the the entry in mail merge list. + @return The value of the mail merge variable. + + If @p record equals -1, @p name is returned. + */ + virtual class TQString getValue( const class TQString &name, int record = -1 ) const; + + /** + @return The number of available contacts in mail merge list. + */ + virtual int getNumRecords() const; + + /** + Only for compatability reasons. + + @param force Hasn't any effect. + */ + virtual void refresh( bool force ); + + /** + Shows a KWMailMergeTDEABCConfig dialog for selecting entries from KAddressbook. + */ + virtual bool showConfigDialog( TQWidget*, int action); + +protected: + friend class KWMailMergeTDEABCConfig; + + /** + Adds an entry from TDEABC::StdAddressBook::self() + to the mail merge list. + + To be called by KWMailMergeTDEABC::load() and + KWMailMergeTDEABCConfig::acceptSelection() only. + + @param uid The entry's TDEABC::Addressee::uid(). + */ + void addEntry( const TQString &uid ); + + /** + Adds a distribution list to the mail merge list. + + To be called by KWMailMergeTDEABC::load() and + KWMailMergeTDEABCConfig::acceptSelection() only. + + @param id The DistributionList::name(). + */ + void addList( const TQString &id ); + + /** + Removes all entries and distribution lists from the mail merge list. + */ + void clear(); + + /** + @return All selected DistributionList::name(). + + To be called by KWMailMergeTDEABCConfig::initSelectedLists() + */ + virtual TQStringList lists() const; + + /** + @return The TDEABC::Addressee::uid() of all individually selected + entries in mail merge list. + + To be called by KWMailMergeTDEABCConfig::initSelectedAddressees() + */ + virtual TQStringList singleRecords() const; + +private: + /** + The TDEABC::StdAddressBook::self(). + */ + TDEABC::AddressBook* _addressBook; + + /** + Just an Iterator. + */ + mutable TDEABC::AddressBook::ConstIterator _iterator; + + /** + Just an Iterator. + */ + mutable TQStringList::ConstIterator _UIDIterator; + + /** + The "real" mail merge list. A list of TQStrings. Each represents + the TDEABC::Addressee::uid() of a KAdressbook entry. + There is no UID twice in this list. + + Needed because selected contacts may appear in a selected + distribution list, too. And we don't want to print it multiple. + */ + TQStringList _exclusiveUIDs; + + /** + This list contains all the TDEABC::Addressee::uid() selected + individually with the KWMailMergeTDEABCConfig dialog. + */ + TQStringList _individualUIDs; + + /** + This list contains all the TDEABC::Addressee::uid() from the distribution + lists selected with the KWMailMergeTDEABCConfig dialog. + */ + TQStringList _listUIDs; + + /** + This list contains all the DistributionList::name() selected with the + KWMailMergeTDEABCConfig dialog. + */ + TQStringList _lists; + + + /** + Appends all TDEABC::Addressee::uid() of a distribution list to _listUIDs + and updates the mail merge list. + + To be used by KWMailMergeTDEABCConfig::addList( const TQString &id ) + only. + + @param listName The DistributionList::name() of the distribution list. + */ + void parseList( const TQString& listName ); + + /** + Removes duplicate entries in the mail merge list. + */ + void makeUIDsExclusive(); + +}; + +#endif + diff --git a/kword/mailmerge/tdeabc/KWMailMergeTDEABCConfig.cpp b/kword/mailmerge/tdeabc/KWMailMergeTDEABCConfig.cpp new file mode 100644 index 00000000..440e208a --- /dev/null +++ b/kword/mailmerge/tdeabc/KWMailMergeTDEABCConfig.cpp @@ -0,0 +1,546 @@ +/* + This file is part of the KDE project + Copyright (C) 2004 Dirk Schmidt <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. +*/ + + +#include <tqvbox.h> +#include <tqlayout.h> +#include <tqlineedit.h> + +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdeglobal.h> +#include <kinputdialog.h> +#include <tdelocale.h> +#include <tdemessagebox.h> +#include <kpushbutton.h> +#include <krun.h> +#include <tdeabc/stdaddressbook.h> +#include <tdeabc/distributionlist.h> + +#include "addresspicker.h" +#include "KWMailMergeTDEABC.h" +#include "KWMailMergeTDEABCConfig.h" + + +KWMailMergeTDEABCConfig::KWMailMergeTDEABCConfig( TQWidget *parent, KWMailMergeTDEABC *db_) + :KDialogBase( Plain, i18n( "Mail Merge - Editor" ), + Ok | Cancel, Ok, parent, "", true) +{ + _db = db_; + + (new TQVBoxLayout(plainPage()))->setAutoAdd(true); + setMainWidget( _ui=new AddressPickerUI( plainPage() ) ); + + updateAvailable(); + initSelectedAddressees(); + initSelectedLists(); + initSlotSignalConnections(); +} + + +KWMailMergeTDEABCConfig::~KWMailMergeTDEABCConfig() +{ + ; +} + + +void KWMailMergeTDEABCConfig::acceptSelection() +{ + _db->clear(); + + TQListViewItem* top = _ui->mSelectedView->firstChild(); + while(top) + { + kdDebug() << "acceptSelection(): " << top->text(0) << endl; + if( top->text(0) == i18n("Distribution Lists") ) + { + TQListViewItem* item = top->firstChild(); + while(item) + { + kdDebug() << "acceptSelection(): " << item->text(0) << endl; + _db->addList( item->text(0) ); + item = item->nextSibling(); + } + } + else if( top->text(0) == i18n("Single Entries") ) + { + TQListViewItem* item = top->firstChild(); + while(item) + { + kdDebug() << "acceptSelection(): " << item->text(0) << endl; + _db->addEntry( item->text(-1) ); + item = item->nextSibling(); + } + } + top = top->nextSibling(); + } + +} + + +void KWMailMergeTDEABCConfig::addSelectedContacts() +{ + TQListViewItemIterator it( _ui->mAvailableView, TQListViewItemIterator::Selected ); + TQListViewItem* selected = _ui->mSelectedView->findItem( + i18n("Single Entries"), 0, TQt::ExactMatch ); + TQListViewItem* selectedLists = _ui->mSelectedView->findItem( + i18n("Distribution Lists"), 0, TQt::ExactMatch ); + while ( it.current() ) + { + if( it.current()->depth() > 0 ) + { + TQString uid = it.current()->text( -1 ); + kdDebug() << "addSelectedContacts(): uid :" << uid << endl; + if( !uid.isEmpty() ) + { + KWMailMergeTDEABCConfigListItem *item = + static_cast<KWMailMergeTDEABCConfigListItem*> ( it.current() ); + if( selected ) + { + selected->insertItem( item ); + selected->setOpen( true ); + destroyAvailableClones( uid ); + } + } + else if( it.current()->parent()->text(0) == i18n("Distribution Lists") ) + { + if( selectedLists ) + { + selectedLists->insertItem( it.current() ); + selectedLists->setOpen( true ); + } + } + } + ++it; + } + _ui->mSelectedView->selectAll( false ); +} + + +void KWMailMergeTDEABCConfig::destroyAvailableClones( const TQString& uid ) +{ + if( uid.isEmpty() ) + return; + + TQListViewItemIterator it( _ui->mAvailableView ); + + while ( it.current() ) + { + if( it.current()->depth() > 0) + { + if( it.current()->text(-1)== uid ) + { + delete it.current(); + } + } + ++it; + } +} + + +void KWMailMergeTDEABCConfig::filterChanged( const TQString& txt ) +{ + kdDebug() << "KWMailMergeTDEABCConfig::filterChanged( " << txt << " )" << endl; + + bool showAll = txt.isEmpty(); + + TQListViewItem* category = _ui->mAvailableView->firstChild(); + while(category) + { + if( category->text(0)!=i18n("Distribution Lists") ) + { + TQListViewItem* item = category->firstChild(); + while(item) + { + if(showAll) + { + item->setVisible( true ); + } + else + { + item->setVisible( item->text(0).contains( txt, false ) ); + } + item = item->nextSibling(); + } + category->setOpen( !showAll ); + } + else + { + category->setVisible( showAll ); + } + category = category->nextSibling(); + } +} + + +void KWMailMergeTDEABCConfig::initSelectedAddressees() +{ + TQStringList records = _db->singleRecords(); + + TQListViewItem* category = _ui->mAvailableView->firstChild(); + TQListViewItem* selected = _ui->mSelectedView->findItem( + i18n("Single Entries"), 0, TQt::ExactMatch ); + while ( category && (records.count()>0) ) + { + if( category->text(0) != i18n("Distribution Lists") ) + { + KWMailMergeTDEABCConfigListItem* item = + static_cast<KWMailMergeTDEABCConfigListItem*> ( category->firstChild() ); + while( item && (records.count()>0) ) + { + // Need some temporary item, because after selected->insertItem( item ) + // the item->nextSibling() is not the one we want. + KWMailMergeTDEABCConfigListItem* nextItem = + static_cast<KWMailMergeTDEABCConfigListItem*> ( item->nextSibling() ); + + for( TQStringList::Iterator itRecords = records.begin(); + itRecords != records.end(); ++itRecords ) + { + TQString uid = *itRecords; + if( item->text(-1) == uid ) + { + selected->insertItem( item ); + + // downsize records to speed up iterations + itRecords = records.remove( itRecords ); + --itRecords; + + destroyAvailableClones( uid ); + } + } + item = nextItem; + } + } + category = category->nextSibling(); + } +} + + +void KWMailMergeTDEABCConfig::initSelectedLists() +{ + TQStringList lists = _db->lists(); + + kdDebug() << "::initSelectedLists()" << lists.join(",") << endl; + + TQListViewItem* l = _ui->mAvailableView->findItem( + i18n("Distribution Lists"), 0, TQt::ExactMatch ); + TQListViewItem* selected = _ui->mSelectedView->findItem( + i18n("Distribution Lists"), 0, TQt::ExactMatch ); + + TQListViewItem* item = ( l->firstChild() ); + while( item && (lists.count()>0) ) + { + TQListViewItem* nextItem = item->nextSibling(); + + for( TQStringList::Iterator itLists = lists.begin(); + itLists != lists.end(); ++itLists ) + { + TQString id = *itLists; + if( item->text(0) == id ) + { + selected->insertItem( item ); + itLists = lists.remove( itLists ); + --itLists; + } + } + item = nextItem; + } +} + + +void KWMailMergeTDEABCConfig::initSlotSignalConnections() +{ + connect( this, TQT_SIGNAL( okClicked() ), TQT_SLOT( acceptSelection() ) ); + connect( _ui->mAddButton, TQT_SIGNAL( clicked() ), TQT_SLOT( addSelectedContacts() ) ); + connect( _ui->mAddressBook, TQT_SIGNAL( clicked() ), TQT_SLOT( launchAddressbook() ) ); + + connect( _ui->mAvailableView, TQT_SIGNAL( doubleClicked( TQListViewItem *, const TQPoint &, int ) ), + TQT_SLOT( addSelectedContacts() ) ); + + connect( _ui->mFilterEdit, TQT_SIGNAL( textChanged(const TQString &) ), + TQT_SLOT( filterChanged(const TQString &) ) ); + connect( _ui->mRemoveButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeSelectedContacts() ) ); + connect( _ui->mSaveList, TQT_SIGNAL( clicked() ), TQT_SLOT( saveDistributionList() ) ); + connect( _ui->mSelectedView, TQT_SIGNAL( doubleClicked( TQListViewItem *, const TQPoint &, int ) ), + TQT_SLOT( removeSelectedContacts() ) ); +} + + +void KWMailMergeTDEABCConfig::launchAddressbook() const +{ + kapp->startServiceByDesktopName( "kaddressbook", TQString() ); +} + + + +void KWMailMergeTDEABCConfig::removeContact( TQListViewItem* item ) +{ + TQStringList& categories = _usedCategories; + TQListViewItem* availableLists = _ui->mAvailableView->findItem( + i18n("Distribution Lists"), 0, TQt::ExactMatch ); + if( item->depth() > 0 ) + { + if( !item->text( -1 ).isEmpty() ) // remove selected single entry here + { + KWMailMergeTDEABCConfigListItem* rightItem = + static_cast<KWMailMergeTDEABCConfigListItem*> ( item ); + + TQStringList entryCategories = rightItem->addressee().categories(); + for ( TQStringList::Iterator itEntryCat = entryCategories.begin(); + itEntryCat != entryCategories.end(); ++itEntryCat ) + { + int i = categories.findIndex(*itEntryCat); + if( i == -1 ) + { + TQListViewItem* category = new TQListViewItem( _ui->mAvailableView, + *itEntryCat ); + categories.append( *itEntryCat ); + + KWMailMergeTDEABCConfigListItem* leftItem = new KWMailMergeTDEABCConfigListItem( + category, rightItem->addressee() ); + } + else + { + KWMailMergeTDEABCConfigListItem* leftItem = new + KWMailMergeTDEABCConfigListItem( + _ui->mAvailableView->findItem( + *itEntryCat, 0, + TQt::ExactMatch), + rightItem->addressee() ); + } + } + if( entryCategories.isEmpty() ) + { + TQString noCat = i18n("no category"); + KWMailMergeTDEABCConfigListItem* leftItem = new KWMailMergeTDEABCConfigListItem( + _ui->mAvailableView->findItem( + noCat, 0, TQt::ExactMatch), + rightItem->addressee() ); + } + delete item; + } + else if( item->parent()->text(0) == i18n("Distribution Lists") ) // remove a list + { + if( availableLists ) + availableLists->insertItem( item ); + } + } +} + +void KWMailMergeTDEABCConfig::removeSelectedContacts() +{ + TQListViewItemIterator it( _ui->mSelectedView, TQListViewItemIterator::Selected ); + + while( it.current() ) + { + kdDebug() << "removeSelectedContacts(): text: " << it.current()->text(-1) << endl; + removeContact( it.current() ); + ++it; + } + _ui->mAvailableView->selectAll( false ); +} + + +void KWMailMergeTDEABCConfig::saveDistributionList() +{ + TDEABC::DistributionListManager dlm( TDEABC::StdAddressBook::self() ); + dlm.load(); + + bool ok = false; + TQString listName = KInputDialog::getText( i18n("New Distribution List"), + i18n("Please enter name:"), + TQString(), &ok, + this ); + if ( !ok || listName.isEmpty() ) + return; + + if ( dlm.list( listName ) ) + { + KMessageBox::information( 0, + i18n( "<qt>Distribution list with the given name <b>%1</b> " + "already exists. Please select a different name.</qt>" ) + .arg( listName ) ); + return; + } + TDEABC::DistributionList *distList = new TDEABC::DistributionList( &dlm, listName ); + + TQListViewItem* newListItem = new TQListViewItem( _ui->mSelectedView->findItem( + i18n("Distribution Lists"),0 , TQt::ExactMatch), listName ); + + TQListViewItem* category = _ui->mSelectedView->firstChild(); + while(category) + { + if( category->text(0)==i18n("Single Entries") ) + { + KWMailMergeTDEABCConfigListItem* item = + static_cast<KWMailMergeTDEABCConfigListItem*> ( category->firstChild() ); + + while(item) + { + distList->insertEntry( item->addressee() ); + + TDEABC::Addressee addr = item->addressee(); + TQString formattedName = addr.formattedName(); + TQListViewItem* newItem = new TQListViewItem( + newListItem, item->addressee().formattedName() ); + newItem->setEnabled( false ); + + item = static_cast<KWMailMergeTDEABCConfigListItem*>( item->nextSibling() ); + } + + TQListViewItemIterator it ( category->firstChild() ); + while( it.current() ) + { + removeContact( it.current() ); + ++it; + } + } + category = category->nextSibling(); + } + + dlm.save(); + newListItem->setOpen( true ); +} + + +void KWMailMergeTDEABCConfig::updateAvailable() +{ + _ui->mAvailableView->clear(); + _ui->mAvailableView->setRootIsDecorated( true ); + + // + // First append the addressees. + // + TQListViewItem* noCategory = new TQListViewItem( _ui->mAvailableView, + i18n("no category") ); + + TQStringList& categories = _usedCategories ; + categories.clear(); + + TDEABC::AddressBook *addressBook = TDEABC::StdAddressBook::self(); + for( TDEABC::AddressBook::Iterator itAddr = addressBook->begin(); + itAddr != addressBook->end(); ++itAddr ) + { + + TQStringList entryCategories = itAddr->categories(); + for ( TQStringList::Iterator itCat = entryCategories.begin(); + itCat != entryCategories.end(); ++itCat ) + { + int i = categories.findIndex(*itCat); + + // Create category, if not yet in listview and append item to it. + if( i == -1 ) + { + TQListViewItem* category = new TQListViewItem( _ui->mAvailableView, *itCat ); + categories.append( *itCat ); + + KWMailMergeTDEABCConfigListItem* item = new KWMailMergeTDEABCConfigListItem( + category, *itAddr ); + } + // Append item to existing category in listview. + else + { + KWMailMergeTDEABCConfigListItem* item = new KWMailMergeTDEABCConfigListItem( + _ui->mAvailableView->findItem( + *itCat, 0, TQt::ExactMatch), + *itAddr ); + } + + } + // If Addressee does not belong to any category, append it to "no category". + if( entryCategories.isEmpty() ) + { + KWMailMergeTDEABCConfigListItem* item = new KWMailMergeTDEABCConfigListItem( + noCategory, *itAddr ); + } + } + + // + // Now append the distribution lists + // + TDEABC::DistributionListManager dlm ( addressBook ); + dlm.load(); + + TQStringList distributionLists = dlm.listNames(); + TQListViewItem* distributionListsItem = new TQListViewItem( _ui->mAvailableView, + i18n("Distribution Lists") ); + + TQStringList::Iterator itDistributionLists; + + for( itDistributionLists = distributionLists.begin(); + itDistributionLists != distributionLists.end(); ++itDistributionLists ) + { + TDEABC::DistributionList* list = dlm.list( *itDistributionLists ); + + TDEABC::DistributionList::Entry::List entries = list->entries(); + + TQListViewItem* listItem = new TQListViewItem( distributionListsItem, + *itDistributionLists ); + + TDEABC::DistributionList::Entry::List::Iterator itList; + for ( itList = entries.begin(); itList != entries.end(); ++itList ) + { + // Create a normal TQListViewItem and disable it, because this is not a + // distribution-list-editor. KAddressbook should be used instead. + TQListViewItem* item = new TQListViewItem( + listItem, (*itList).addressee.formattedName() ); + item->setEnabled( false ); + } + + } +} + + + +KWMailMergeTDEABCConfigListItem::KWMailMergeTDEABCConfigListItem( TQListView *parent, + const TDEABC::Addressee& addressEntry ) : TQListViewItem( parent ) +{ + setText( 0, addressEntry.formattedName() ); + _addressEntry = addressEntry; +} + +KWMailMergeTDEABCConfigListItem::KWMailMergeTDEABCConfigListItem( TQListViewItem *parent, + const TDEABC::Addressee& addressEntry ) : TQListViewItem( parent ) +{ + setText( 0, addressEntry.formattedName() ); + _addressEntry = addressEntry; +} + +KWMailMergeTDEABCConfigListItem::~KWMailMergeTDEABCConfigListItem() +{} + +TDEABC::Addressee KWMailMergeTDEABCConfigListItem::addressee() const +{ + return _addressEntry; +} + +TQString KWMailMergeTDEABCConfigListItem::text( int column ) const +{ + if( column == -1 ) + { + return _addressEntry.uid(); + } + else + { + return TQListViewItem::text( column ); + } +} + +#include "KWMailMergeTDEABCConfig.moc" diff --git a/kword/mailmerge/tdeabc/KWMailMergeTDEABCConfig.h b/kword/mailmerge/tdeabc/KWMailMergeTDEABCConfig.h new file mode 100644 index 00000000..1a23b44c --- /dev/null +++ b/kword/mailmerge/tdeabc/KWMailMergeTDEABCConfig.h @@ -0,0 +1,150 @@ +/* + This file is part of the KDE project + Copyright (C) 2004 Dirk Schmidt <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. +*/ + +#ifndef _KWMAILMERGE_KABC_CONFIG_H_ +#define _KWMAILMERGE_KABC_CONFIG_H_ + +#include <kdialogbase.h> +#include <tdelistview.h> +#include <tdeabc/stdaddressbook.h> + +#include "KWMailMergeTDEABC.h" + + +class AddressPickerUI; +class KWMailMergeTDEABC; + +class KWMailMergeTDEABCConfig: public KDialogBase +{ + Q_OBJECT + +public: + KWMailMergeTDEABCConfig( TQWidget *parent, KWMailMergeTDEABC *db_ ); + virtual ~KWMailMergeTDEABCConfig(); + + +private slots: + + /** + Moves selected items from the left Listview to the right one. + */ + void addSelectedContacts(); + + /** + Moves selected items from the right Listview to the left one. + */ + void removeSelectedContacts(); + + /** + Executes KAddressbook as external application. + */ + void launchAddressbook() const; + + /** + Updates the parent's mail merge list from items in the right Listview. + */ + void acceptSelection(); + + /** + Hides items in the left listview, which are not matching @p txt. + */ + void filterChanged( const TQString& txt ); + + /** + Saves the selected single entries to a new TDEABC::DistributionList in KAddressbook. + */ + void saveDistributionList(); +private: + /** + The addresspicker widget. + */ + AddressPickerUI *_ui; + + /** + Store all categories used in the addressbook, to avoid some iterator cycles. + */ + TQStringList _usedCategories; + + /** + The mail merge list. + */ + KWMailMergeTDEABC *_db; + + /** + Removes duplicates in the left TQListView, when moving an item to the right. + */ + void destroyAvailableClones( const TQString& uid ); + + /** + Appends the previously selected entries to the right TQListView. + */ + void initSelectedAddressees(); + + /** + Appends the previously selected distribution lists to the right TQListView. + */ + void initSelectedLists(); + + /** + Just connects signals and slots. + */ + void initSlotSignalConnections(); + + /** + Moves @p item from the right Listview to the left one. + + Called by KWMailMergeTDEABCConfig::removeSelectedContacts(). + */ + void removeContact( TQListViewItem* item ); + + /** + Appends all KAddressbook entries in TDEABC::StdAddressBook::self() and all + TDEABC::DistributionLists to the left TQListView. + */ + void updateAvailable(); +}; + + +class KWMailMergeTDEABCConfigListItem : public TQListViewItem +{ + +public: + KWMailMergeTDEABCConfigListItem( TQListView *parent, const TDEABC::Addressee& addressEntry ); + KWMailMergeTDEABCConfigListItem( TQListViewItem *parent, const TDEABC::Addressee& addressEntry ); + virtual ~KWMailMergeTDEABCConfigListItem(); + + /** + Returns the TDEABC::Addressee of a KWMailMergeTDEABCConfigListItem. + */ + TDEABC::Addressee addressee() const; + + /** + This is an overloaded member function of TQListViewItem::text( int column ). + It Returns the TDEABC::Addressee::uid(), if column is set to -1. + Otherwise TQListViewItem::text( int column ) is returned. + */ + TQString text( int column ) const; + + +private: + TDEABC::Addressee _addressEntry; + +}; +#endif diff --git a/kword/mailmerge/tdeabc/Makefile.am b/kword/mailmerge/tdeabc/Makefile.am new file mode 100644 index 00000000..0856d2c6 --- /dev/null +++ b/kword/mailmerge/tdeabc/Makefile.am @@ -0,0 +1,17 @@ + +KDE_CXXFLAGS = $(USE_RTTI) +INCLUDES = $(KOFFICE_INCLUDES) -I$(top_srcdir)/lib/kformula \ + $(KOTEXT_INCLUDES) -I$(top_srcdir)/kword $(all_includes) + +kde_module_LTLIBRARIES = kwmailmerge_tdeabc.la + +## Plugin encapsulating the QT SQL database interface +kwmailmerge_tdeabc_la_SOURCES = KWMailMergeTDEABC.cpp KWMailMergeTDEABCConfig.cpp addresspicker.ui +kwmailmerge_tdeabc_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) -lDCOP -ltdecore -ltdeui $(LIB_QT) -lkjs -ltdefx -ltdeio -ltdeparts +kwmailmerge_tdeabc_la_LIBADD = $(KOFFICE_LIBS) ../../libkwmailmerge_interface.la $(LIB_TDEUI) $(LIB_TDEABC) + +METASOURCES = AUTO + +services_DATA=kwmailmerge_tdeabc.desktop +servicesdir=$(kde_servicesdir) + diff --git a/kword/mailmerge/tdeabc/addresspicker.ui b/kword/mailmerge/tdeabc/addresspicker.ui new file mode 100644 index 00000000..44dc8c8f --- /dev/null +++ b/kword/mailmerge/tdeabc/addresspicker.ui @@ -0,0 +1,297 @@ +<!DOCTYPE UI><UI version="3.2" stdsetdef="1"> +<class>AddressPickerUI</class> +<widget class="TQWidget"> + <property name="name"> + <cstring>AddressPickerUI</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>617</width> + <height>434</height> + </rect> + </property> + <property name="caption"> + <string>Address Selection</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQLayoutWidget" row="1" column="1"> + <property name="name"> + <cstring>layout10</cstring> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <spacer> + <property name="name"> + <cstring>spacer1</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>16</height> + </size> + </property> + </spacer> + <widget class="KPushButton"> + <property name="name"> + <cstring>mAddButton</cstring> + </property> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="text"> + <string>&Add >></string> + </property> + </widget> + <widget class="KPushButton"> + <property name="name"> + <cstring>mRemoveButton</cstring> + </property> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="text"> + <string><< &Remove</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer2_2</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </vbox> + </widget> + <widget class="TQPushButton" row="2" column="2"> + <property name="name"> + <cstring>mSaveList</cstring> + </property> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="text"> + <string>Save as &Distribution List...</string> + </property> + <property name="toolTip" stdset="0"> + <string>Save selected single entries to a new distribution list.</string> + </property> + </widget> + <widget class="TQLayoutWidget" row="2" column="0"> + <property name="name"> + <cstring>layout1</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQLabel"> + <property name="name"> + <cstring>TextLabel2</cstring> + </property> + <property name="text"> + <string>&Filter on:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>mFilterEdit</cstring> + </property> + </widget> + <widget class="TQLineEdit"> + <property name="name"> + <cstring>mFilterEdit</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>1</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string></string> + </property> + </widget> + </hbox> + </widget> + <widget class="TDEListView" row="1" column="2"> + <column> + <property name="text"> + <string>Name</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizable"> + <bool>true</bool> + </property> + </column> + <item> + <property name="text"> + <string>Distribution Lists</string> + </property> + <property name="pixmap"> + <pixmap></pixmap> + </property> + </item> + <item> + <property name="text"> + <string>Single Entries</string> + </property> + <property name="pixmap"> + <pixmap></pixmap> + </property> + </item> + <property name="name"> + <cstring>mSelectedView</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>1</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="selectionMode" stdset="0"> + <enum>Extended</enum> + </property> + <property name="allColumnsShowFocus"> + <bool>true</bool> + </property> + <property name="showSortIndicator"> + <bool>true</bool> + </property> + <property name="rootIsDecorated"> + <bool>true</bool> + </property> + <property name="resizeMode"> + <enum>AllColumns</enum> + </property> + <property name="fullWidth"> + <bool>true</bool> + </property> + </widget> + <widget class="TQPushButton" row="2" column="1"> + <property name="name"> + <cstring>mAddressBook</cstring> + </property> + <property name="text"> + <string>Address B&ook</string> + </property> + <property name="toolTip" stdset="0"> + <string>Launch KAddressbook</string> + </property> + </widget> + <widget class="TQLabel" row="0" column="0"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="font"> + <font> + <bold>1</bold> + </font> + </property> + <property name="text"> + <string>&Address Book</string> + </property> + <property name="alignment"> + <set>WordBreak|AlignCenter</set> + </property> + <property name="buddy" stdset="0"> + <cstring>mAvailableView</cstring> + </property> + </widget> + <widget class="TQLabel" row="0" column="2"> + <property name="name"> + <cstring>textLabel2</cstring> + </property> + <property name="font"> + <font> + <bold>1</bold> + </font> + </property> + <property name="text"> + <string>&Selected Addresses</string> + </property> + <property name="alignment"> + <set>WordBreak|AlignCenter</set> + </property> + <property name="buddy" stdset="0"> + <cstring>mSelectedView</cstring> + </property> + </widget> + <widget class="TDEListView" row="1" column="0"> + <column> + <property name="text"> + <string>Name</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizable"> + <bool>true</bool> + </property> + </column> + <property name="name"> + <cstring>mAvailableView</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>7</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="selectionMode" stdset="0"> + <enum>Extended</enum> + </property> + <property name="allColumnsShowFocus"> + <bool>true</bool> + </property> + <property name="showSortIndicator"> + <bool>true</bool> + </property> + <property name="rootIsDecorated"> + <bool>true</bool> + </property> + <property name="resizeMode"> + <enum>AllColumns</enum> + </property> + <property name="fullWidth"> + <bool>true</bool> + </property> + </widget> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +<includehints> + <includehint>kpushbutton.h</includehint> + <includehint>kpushbutton.h</includehint> + <includehint>tdelistview.h</includehint> + <includehint>tdelistview.h</includehint> +</includehints> +</UI> diff --git a/kword/mailmerge/tdeabc/kwmailmerge_tdeabc.desktop b/kword/mailmerge/tdeabc/kwmailmerge_tdeabc.desktop new file mode 100644 index 00000000..924d6516 --- /dev/null +++ b/kword/mailmerge/tdeabc/kwmailmerge_tdeabc.desktop @@ -0,0 +1,105 @@ +[Desktop Entry] +Type=Service +ServiceTypes=KWord/MailMergePlugin + +Name=TDE Addressbook Plugin +Name[bg]=Приставка за адресника на TDE +Name[br]=Lugent Karned chomlec'hioù TDE +Name[ca]=Connector de llibreta d'adreces TDE +Name[cs]=Modul Knihy adres TDE +Name[cy]=Ategyn Llyfr Cyfeiriadau TDE +Name[da]=TDE's adressebog Plugin +Name[de]=TDE Adressbuch-Modul +Name[el]=Πρόσθετο βιβλίου διευθύνσεων του TDE +Name[eo]=TDE Adresaro-kromprogramo +Name[es]=Accesorio de la libreta de direcciones de TDE +Name[et]=TDE aadressiraamatu plugin +Name[eu]=TDE-ren helbide-liburuaren plugina +Name[fa]=وصلۀ کتاب نشانی TDE +Name[fi]=TDE:n osoitekirjan liitännäinen +Name[fr]=Module externe de carnet d'adresses de TDE +Name[fy]=Adresboekplugin foar TDE +Name[gl]=Plugin do Libro de Enderezos de TDE +Name[he]=תוסף של פנקס הכתובות של TDE +Name[hi]=केडीई पतापुस्तिका प्लगिन +Name[hr]=TDE dodatak adresara +Name[hu]=Illesztőmodul a TDE címjegyzékhez +Name[is]=TDE vistfanga íforrit +Name[it]=Plugin per la rubrica degli indirizzi TDE +Name[ja]=TDE アドレス帳プラグイン +Name[km]=កម្មវិធីជំនួយសៀវភៅអាសយដ្ឋាន TDE +Name[lv]=TDE adrešu grāmatiņas spraudnis +Name[ms]=Plugin Buku Alamat TDE +Name[nb]=Programtillegg for TDE-adresseboka +Name[nds]=Adressbook-Moduul för TDE +Name[ne]=TDE ठेगानापुस्तक प्लगइन +Name[nl]=Adresboekplugin voor TDE +Name[nn]=Programtillegg for TDE-adresseboka +Name[pl]=Wtyczka Książki adresowej TDE +Name[pt]='Plugin' do Livro de Endereços do TDE +Name[pt_BR]=Livro de Endereços do TDE +Name[ru]=Модуль адресной книги TDE +Name[se]=TDE:a čujuhusgirjemoduvla +Name[sk]=Modul pre TDE adresár +Name[sl]=Vstavek Adresar TDE +Name[sr]=Прикључак за TDE-ов адресар +Name[sr@Latn]=Priključak za TDE-ov adresar +Name[sv]=Insticksprogram för TDE:s adressbok +Name[ta]= TDE முகவரிப்புத்தகம் சொருகு +Name[tg]=Дарҷ кардани TDE Китоби Адресҳо +Name[tr]=TDE Adres Defteri Eklentisi +Name[uk]=Втулок адресної книги TDE +Name[uz]=TDE manzillar daftari plagini +Name[uz@cyrillic]=TDE манзиллар дафтари плагини +Name[wa]=Tchôke-divins calpin d' adresses TDE +Name[zh_CN]=TDE 地址簿插件 +Name[zh_TW]=TDE 通訊錄外掛程式 +Comment=This datasource type lets you use your TDE Address Book entries. +Comment[bg]=Този източник на данни се свързва директно с адресника на TDE и чете данните от там. +Comment[ca]=Aquest tipus de font de dades permet usar les entrades de la llibreta d'adreces del TDE. +Comment[cs]=Tento zdroj dat umožňuje využít položky z Knihy adres. +Comment[cy]=Mae'r math yma o ffynhonell ddata yn eich galluogi i ddefnyddio eich cofnodion Llyfr Cyfeiriadau TDE. +Comment[da]=Denne datakildetype lader dig bruge dine TDE adressebogsindgange. +Comment[de]=Dieser Quellentyp ermöglicht die Verwendung von TDE-Adressbucheinträgen. +Comment[el]=Αυτή η πηγή δεδομένων σας επιτρέπει να χρησιμοποιήσετε τις καταχωρήσεις σας από το βιβλίο διευθύνσεων του TDE. +Comment[es]=Este tipo de fuente de datos le permite usar las entradas de su libreta de direcciones de TDE. +Comment[et]=See andmeallika tüüp võimaldab kasutada TDE aadressiraamatu kirjeid. +Comment[eu]=Datu-iturburu honek zure TDE-ko helbide-liburuko sarrerak erabiltzeko aukera ematen dizu. +Comment[fa]=این نوع متن داده به شما اجازۀ استفاده از مدخلهای کتاب نشانی TDE را میدهد. +Comment[fi]=Tämän tietolähteen avulla voit käyttää TDE:n osoitekirjan tietoja. +Comment[fr]=Ce type de source de données vous permet d'utiliser votre carnet d'adresses TDE. +Comment[fy]=Mei dizze plugin ha jo taging ta jo TDE adresboek. +Comment[gl]=Este tipo de fonte de datos armacena os datos directamente no Libro de Enderezos de TDE. +Comment[he]=טיפוס מקור נתונים זה מאפשר לך להשתמש ברשומות שלך מתוך פנקס הכתובות של TDE. +Comment[hi]=यह डाटा स्रोत क़िस्म आपको केडीई पता पुस्तिका प्रविष्टियों को इस्तेमाल करने देती है. +Comment[hu]=Ez az adatforrástípus a TDE címjegyzék adatait teszi hozzáférhetővé. +Comment[is]=Þessi auðlindategund gerir þér kleyft að nota færslur frá TDE vistfangaskránni þinni. +Comment[it]=Questo tipo di fonte di dati permette di usare le voci della rubrica degli indirizzi di TDE. +Comment[ja]=TDE アドレス帳のデータを使用できるようにします。 +Comment[km]=ប្រភេទប្រភពទិន្នន័យនេះអនុញ្ញាតឲ្យអ្នកប្រើធាតុសៀវភៅអាសយដ្ឋាន TDE របស់អ្នក ។ +Comment[ms]=Jenis sumber data ini membenarkan anda menggunakan entri Buku Alamat TDE anda. +Comment[nb]=Med denne datakildetypen kan du få tilgang til oppføringene i TDE-adresseboka. +Comment[nds]=Mit dissen Datenborntyp laat sik TDE-Adressbookindrääg bruken. +Comment[ne]=यो डेटासंसाधनले तपाईंलाई तपाईंको TDE ठेगाना पुस्तक प्रविष्टिहरू प्रयोग गर्न दिन्छ । +Comment[nl]=Via deze plugin hebt u toegang tot uw TDE-adresboek. +Comment[nn]=Med denne datakjeldetypen kan du få tilgang til oppføringane i TDE-adresseboka. +Comment[pl]=To źródło danych pozwala Ci używać Twoich wpisów z Książki adresowej TDE. +Comment[pt]=Este tipo de fonte de dados armazena os dados directamente no Livro de Endereços do TDE. +Comment[pt_BR]=Este tipo de fonte de dados permite-lhe usar suas entradas do Livro de Endereços do TDE. +Comment[ru]=Источник данных, работающий с записями адресной книги TDE +Comment[se]=Dát dáhtagáldu diktá du geavahit TDE-čujuhusgirjemerkošiid. +Comment[sk]=Tento typ zdroja dát umožňuje používať záznamy z TDE adresára. +Comment[sl]=Ta tip vira podatkov vam omogoča uporabljati vnose vašega Adresarja TDE. +Comment[sr]=Овај тип извора података омогућава вам да користите ставке из TDE-овог адресара. +Comment[sr@Latn]=Ovaj tip izvora podataka omogućava vam da koristite stavke iz TDE-ovog adresara. +Comment[sv]=Den här typen av datakälla låter dig använda information från TDE:s adressbok +Comment[ta]=பலகத்தின் தோற்றத்தை நீங்கள் இங்கே வடிவமைக்கலாம். +Comment[tg]=Ин намуди манбаъи маълумот гузоштани шумо истифода кардан шуморо воридҳои Китоби Адресҳои TDE. +Comment[tr]=Bu veri kaynağı biçimi TDE Adres Defteri girdilerini kullanmanızı sağlar. +Comment[uk]=Цей тип джерела даних дає доступ до записів адресної книги TDE. +Comment[zh_CN]=该数据源类型允许您使用您的 TDE 地址簿条目。 +Comment[zh_TW]=這個資料來源類別讓您使用您的 TDE 通訊錄項目。 + +X-TDE-Library=kwmailmerge_tdeabc +X-TDE-Capabilities=open +X-TDE-InternalName=KABC |