25#include <tqsignalmapper.h>
29#include <tdemessagebox.h>
30#include <tdeapplication.h>
35class XXPort::XXPortPrivate
38 TQSignalMapper *mExportMapper;
39 TQSignalMapper *mImportMapper;
40 TDEApplication *mKApp;
43XXPort::XXPort( TDEABC::AddressBook *ab, TQWidget *parent,
45 : TQObject( parent, name ), mAddressBook( ab ), mParentWidget( parent ),
46 d( new XXPortPrivate )
48 setInstance(
new TDEInstance(
"kaddressbook" ) );
50 d->mExportMapper =
new TQSignalMapper(
this );
51 d->mImportMapper =
new TQSignalMapper(
this );
53 connect( d->mExportMapper, TQ_SIGNAL( mapped(
const TQString& ) ),
54 TQ_SLOT( slotExportActivated(
const TQString& ) ) );
55 connect( d->mImportMapper, TQ_SIGNAL( mapped(
const TQString& ) ),
56 TQ_SLOT( slotImportActivated(
const TQString& ) ) );
65bool XXPort::exportContacts(
const TDEABC::AddresseeList&,
const TQString& )
71TDEABC::AddresseeList XXPort::importContacts(
const TQString& )
const
74 return TDEABC::AddresseeList();
77void XXPort::createImportAction(
const TQString &label,
const TQString &data )
79 TQString
id =
"file_import_" + identifier() + ( data.isEmpty() ? TQString(
"" ) :
"_" + data );
80 TDEAction *action =
new TDEAction( label, 0, d->mImportMapper, TQ_SLOT( map() ), actionCollection(),
id.latin1() );
82 d->mImportMapper->setMapping( action, ( data.isEmpty() ? TQString(
"<empty>" ) : data ) );
84 setXMLFile( identifier() +
"_xxportui.rc" );
87void XXPort::createExportAction(
const TQString &label,
const TQString &data )
89 TQString
id =
"file_export_" + identifier() + ( data.isEmpty() ? TQString(
"" ) :
"_" + data );
90 TDEAction *action =
new TDEAction( label, 0, d->mExportMapper, TQ_SLOT( map() ), actionCollection(),
id.latin1() );
92 d->mExportMapper->setMapping( action, ( data.isEmpty() ? TQString(
"<empty>" ) : data ) );
94 setXMLFile( identifier() +
"_xxportui.rc" );
97TDEABC::AddressBook *XXPort::addressBook()
const
102TQWidget *XXPort::parentWidget()
const
104 return mParentWidget;
107void XXPort::setTDEApplication( TDEApplication *app )
112void XXPort::processEvents()
const
115 d->mKApp->processEvents();
118void XXPort::slotExportActivated(
const TQString &data )
120 emit exportActivated( identifier(), ( data ==
"<empty>" ? TQString() : data ) );
123void XXPort::slotImportActivated(
const TQString &data )
125 emit importActivated( identifier(), ( data ==
"<empty>" ? TQString() : data ) );