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_CONTACTEDITORWIDGET_H
00025
#define KAB_CONTACTEDITORWIDGET_H
00026
00027
#include <qwidget.h>
00028
00029
#include <kabc/addressbook.h>
00030
#include <klibloader.h>
00031
00032
namespace KAB {
00033
00034
class ContactEditorWidget :
public QWidget
00035 {
00036 Q_OBJECT
00037
00038
public:
00039
typedef QValueList<ContactEditorWidget*> List;
00040
00041 ContactEditorWidget( KABC::AddressBook *ab,
QWidget *parent,
const char *name = 0 );
00042 ~ContactEditorWidget();
00043
00049
virtual int logicalHeight()
const {
return 1; }
00050
00056
virtual int logicalWidth()
const {
return 1; }
00057
00061
virtual void loadContact( KABC::Addressee *addr ) = 0;
00062
00067
virtual void storeContact( KABC::Addressee *addr ) = 0;
00068
00074
virtual void setReadOnly(
bool readOnly ) = 0;
00075
00079
bool modified() const;
00080
00081 signals:
00086
void changed();
00087
00088 public slots:
00095
void setModified(
bool modified );
00096
00097
void setModified();
00098
00099 protected:
00103 KABC::AddressBook *addressBook() const;
00104
00105 private:
00106 KABC::AddressBook *mAddressBook;
00107
bool mModified;
00108
00109 class ContactEditorWidgetPrivate;
00110 ContactEditorWidgetPrivate *d;
00111 };
00112
00113 class ContactEditorWidgetFactory : public KLibFactory
00114 {
00115
public:
00116
virtual ContactEditorWidget *createWidget( KABC::AddressBook *ab,
QWidget *parent,
00117
const char *name = 0 ) = 0;
00118
00122
virtual QString pageTitle()
const {
return ""; }
00123
00128
virtual QString pageIdentifier() const = 0;
00129
00130 protected:
00131 virtual
QObject* createObject(
QObject*, const
char*, const
char*,
00132 const
QStringList & )
00133 {
00134
return 0;
00135 }
00136 };
00137
00138 }
00139
00140
#endif