xxport.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef KAB_XXPORT_H
00025 #define KAB_XXPORT_H
00026
00027 #include <qobject.h>
00028
00029 #include <kabc/addressbook.h>
00030 #include <kabc/addresseelist.h>
00031 #include <klibloader.h>
00032 #include <kxmlguiclient.h>
00033
00034 class KApplication;
00035
00043 #define K_EXPORT_KADDRESSBOOK_XXFILTER_CATALOG( libname, XXPortClass, catalog ) \
00044 class KDE_NO_EXPORT localXXPortFactory : public KAB::XXPortFactory { \
00045 KAB::XXPort *xxportObject( KABC::AddressBook *ab, QWidget *parent, const char *name ) \
00046 { const char *cat = catalog; \
00047 if (cat) KGlobal::locale()->insertCatalogue(cat); \
00048 return new XXPortClass( ab, parent, name ); \
00049 } \
00050 }; \
00051 K_EXPORT_COMPONENT_FACTORY( libname, localXXPortFactory )
00052
00059 #define K_EXPORT_KADDRESSBOOK_XXFILTER( libname, XXPortClass ) \
00060 K_EXPORT_KADDRESSBOOK_XXFILTER_CATALOG( libname, XXPortClass, NULL )
00061
00062 namespace KAB {
00063
00064 class XXPort : public QObject, virtual public KXMLGUIClient
00065 {
00066 Q_OBJECT
00067
00068 public:
00069 XXPort( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 );
00070 ~XXPort();
00071
00076 virtual QString identifier() const = 0;
00077
00082 virtual bool requiresSorting() const { return false; }
00083
00088 void setKApplication( KApplication *app );
00089
00096 void processEvents() const;
00097
00098 public slots:
00102 virtual bool exportContacts( const KABC::AddresseeList &list, const QString& identifier );
00103
00107 virtual KABC::AddresseeList importContacts( const QString& identifier ) const;
00108
00109 signals:
00115 void exportActivated( const QString&, const QString& );
00116
00122 void importActivated( const QString&, const QString& );
00123
00124 protected:
00128 void createImportAction( const QString &label, const QString &identifier = QString::null );
00129
00133 void createExportAction( const QString &label, const QString &identifier = QString::null );
00134
00138 KABC::AddressBook *addressBook() const;
00139
00144 QWidget *parentWidget() const;
00145
00146 private slots:
00147 void slotImportActivated( const QString& );
00148 void slotExportActivated( const QString& );
00149
00150 private:
00151 KABC::AddressBook *mAddressBook;
00152 QWidget *mParentWidget;
00153
00154 class XXPortPrivate;
00155 XXPortPrivate *d;
00156 };
00157
00158 class XXPortFactory : public KLibFactory
00159 {
00160 public:
00161 virtual XXPort *xxportObject( KABC::AddressBook *ab, QWidget *parent,
00162 const char *name = 0 ) = 0;
00163
00164 protected:
00165 virtual QObject* createObject( QObject*, const char*, const char*,
00166 const QStringList & )
00167 {
00168 return 0;
00169 }
00170 };
00171
00172 }
00173
00174 #endif
This file is part of the documentation for kaddressbook Library Version 3.3.2.