akonadi/contact
displaynameeditwidget.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef DISPLAYNAMEEDITWIDGET_H
00023 #define DISPLAYNAMEEDITWIDGET_H
00024
00025 #include <QtGui/QWidget>
00026
00027 #include <kabc/addressee.h>
00028
00029 class KComboBox;
00030
00037 class DisplayNameEditWidget : public QWidget
00038 {
00039 Q_OBJECT
00040
00041 public:
00045 enum DisplayType
00046 {
00047 SimpleName,
00048 FullName,
00049 ReverseNameWithComma,
00050 ReverseName,
00051 Organization,
00052 CustomName
00053 };
00054
00055 explicit DisplayNameEditWidget( QWidget *parent = 0 );
00056 ~DisplayNameEditWidget();
00057
00058 void loadContact( const KABC::Addressee &contact );
00059 void storeContact( KABC::Addressee &contact ) const;
00060
00061 void setReadOnly( bool readOnly );
00062
00063 void setDisplayType( DisplayType type );
00064 DisplayType displayType() const;
00065
00066 public Q_SLOTS:
00067 void changeName( const KABC::Addressee &contact );
00068 void changeOrganization( const QString &organization );
00069
00070 protected:
00071 virtual bool eventFilter( QObject *object, QEvent *event );
00072
00073 private Q_SLOTS:
00074 void displayTypeChanged( int );
00075
00076 private:
00077 void updateView();
00078
00079 KComboBox *mView;
00080 DisplayType mDisplayType;
00081 KABC::Addressee mContact;
00082 QWidget *mViewport;
00083 int mAdditionalPopupWidth;
00084 };
00085
00086 #endif