29 #include <tdeabc/addressbook.h>
30 #include <tdeabc/addresseelist.h>
31 #include <klibloader.h>
32 #include <kxmlguiclient.h>
33 #include <tdemacros.h>
35 #define KAB_XXPORT_PLUGIN_VERSION 1
46 #define K_EXPORT_KADDRESSBOOK_XXFILTER_CATALOG( libname, XXPortClass, catalog ) \
47 class TDE_NO_EXPORT localXXPortFactory : public KAB::XXPortFactory { \
48 KAB::XXPort *xxportObject( TDEABC::AddressBook *ab, TQWidget *parent, const char *name ) \
49 { const char *cat = catalog; \
50 if (cat) TDEGlobal::locale()->insertCatalogue(cat); \
51 return new XXPortClass( ab, parent, name ); \
54 K_EXPORT_COMPONENT_FACTORY( libname, localXXPortFactory )
62 #define K_EXPORT_KADDRESSBOOK_XXFILTER( libname, XXPortClass ) \
63 K_EXPORT_KADDRESSBOOK_XXFILTER_CATALOG( libname, XXPortClass, NULL )
68 class TDE_EXPORT XXPort : public TQObject, virtual public KXMLGUIClient
74 XXPort( TDEABC::AddressBook *ab, TQWidget *parent, const char *name = 0 );
81 virtual TQString identifier() const = 0;
87 virtual bool requiresSorting() const { return false; }
93 void setTDEApplication( TDEApplication *app );
101 void processEvents() const;
107 virtual bool exportContacts( const TDEABC::AddresseeList &list, const TQString& identifier );
112 virtual TDEABC::AddresseeList importContacts( const TQString& identifier ) const;
120 void exportActivated( const TQString&, const TQString& );
127 void importActivated( const TQString&, const TQString& );
133 void createImportAction( const TQString &label, const TQString &identifier = TQString() );
138 void createExportAction( const TQString &label, const TQString &identifier = TQString() );
143 TDEABC::AddressBook *addressBook() const;
149 TQWidget *parentWidget() const;
152 void slotImportActivated( const TQString& );
153 void slotExportActivated( const TQString& );
156 TDEABC::AddressBook *mAddressBook;
157 TQWidget *mParentWidget;
163 class XXPortFactory : public KLibFactory
166 virtual XXPort *xxportObject( TDEABC::AddressBook *ab, TQWidget *parent,
167 const char *name = 0 ) = 0;
170 virtual TQObject* createObject( TQObject*, const char*, const char*,
171 const TQStringList & )
|