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
00036
namespace KAB {
00037
00038
class XXPort :
public QObject,
virtual public KXMLGUIClient
00039 {
00040 Q_OBJECT
00041
00042
public:
00043 XXPort( KABC::AddressBook *ab,
QWidget *parent,
const char *name = 0 );
00044 ~XXPort();
00045
00050
virtual QString identifier() const = 0;
00051
00056 virtual
bool requiresSorting()
const {
return false; }
00057
00062
void setKApplication( KApplication *app );
00063
00070
void processEvents() const;
00071
00072 public slots:
00076 virtual
bool exportContacts( const KABC::AddresseeList &list, const
QString& identifier );
00077
00081 virtual KABC::AddresseeList importContacts( const
QString& identifier ) const;
00082
00083 signals:
00089
void exportActivated( const
QString&, const QString& );
00090
00096
void importActivated( const QString&, const QString& );
00097
00098 protected:
00102
void createImportAction( const QString &label, const QString &identifier = QString::null );
00103
00107
void createExportAction( const QString &label, const QString &identifier = QString::null );
00108
00112 KABC::AddressBook *addressBook() const;
00113
00118
QWidget *parentWidget() const;
00119
00120 private slots:
00121
void slotImportActivated( const QString& );
00122
void slotExportActivated( const QString& );
00123
00124 private:
00125 KABC::AddressBook *mAddressBook;
00126
QWidget *mParentWidget;
00127
00128 class XXPortPrivate;
00129 XXPortPrivate *d;
00130 };
00131
00132 class XXPortFactory : public KLibFactory
00133 {
00134
public:
00135
virtual XXPort *xxportObject( KABC::AddressBook *ab,
QWidget *parent,
00136
const char *name = 0 ) = 0;
00137
00138
protected:
00139
virtual QObject* createObject(
QObject*,
const char*,
const char*,
00140
const QStringList & )
00141 {
00142
return 0;
00143 }
00144 };
00145
00146 }
00147
00148
#endif