25 #include <tqsignalmapper.h>
27 #include <tdeaction.h>
28 #include <kinstance.h>
29 #include <tdemessagebox.h>
30 #include <tdeapplication.h>
35 class XXPort::XXPortPrivate
38 TQSignalMapper *mExportMapper;
39 TQSignalMapper *mImportMapper;
40 TDEApplication *mKApp;
43 XXPort::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& ) ) );
65 bool XXPort::exportContacts(
const TDEABC::AddresseeList&,
const TQString& )
71 TDEABC::AddresseeList XXPort::importContacts(
const TQString& )
const
74 return TDEABC::AddresseeList();
77 void 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" );
87 void 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" );
97 TDEABC::AddressBook *XXPort::addressBook()
const
102 TQWidget *XXPort::parentWidget()
const
104 return mParentWidget;
107 void XXPort::setTDEApplication( TDEApplication *app )
112 void XXPort::processEvents()
const
115 d->mKApp->processEvents();
118 void XXPort::slotExportActivated(
const TQString &data )
120 emit exportActivated( identifier(), ( data ==
"<empty>" ? TQString() : data ) );
123 void XXPort::slotImportActivated(
const TQString &data )
125 emit importActivated( identifier(), ( data ==
"<empty>" ? TQString() : data ) );
128 #include "xxport.moc"