28 #include <tqpushbutton.h>
30 #include <tdeabc/picture.h>
31 #include <kdialogbase.h>
33 #include "contacteditorwidget.h"
46 TDEABC::Picture loadPicture(
const KURL &url,
bool *ok );
49 TDEABC::Picture mPicture;
62 ImageButton(
const TQString &title, TQWidget *parent );
64 void setReadOnly(
bool readOnly );
66 void setPicture(
const TDEABC::Picture &picture );
67 TDEABC::Picture picture()
const;
73 void urlDropped(
const KURL& );
76 virtual void dragEnterEvent( TQDragEnterEvent *event );
77 virtual void dropEvent( TQDropEvent *event );
78 virtual void mouseMoveEvent( TQMouseEvent *event );
79 virtual void mousePressEvent( TQMouseEvent *event );
80 virtual void contextMenuEvent( TQContextMenuEvent *event );
91 TQPoint mDragStartPos;
92 TDEABC::Picture mPicture;
98 class ImageBaseWidget :
public TQWidget
104 ImageBaseWidget(
const TQString &title, TQWidget *parent,
const char *name = 0 );
110 void setImage(
const TDEABC::Picture &photo );
115 TDEABC::Picture image()
const;
117 void setReadOnly(
bool readOnly );
129 class ImageWidget :
public KAB::ContactEditorWidget
132 ImageWidget( TDEABC::AddressBook *ab, TQWidget *parent,
const char *name = 0 );
134 void loadContact( TDEABC::Addressee *addr );
135 void storeContact( TDEABC::Addressee *addr );
136 void setReadOnly(
bool readOnly );
138 int logicalWidth()
const {
return 2; }
141 ImageBaseWidget *mPhotoWidget;
142 ImageBaseWidget *mLogoWidget;
145 class ImageWidgetFactory :
public KAB::ContactEditorWidgetFactory
148 KAB::ContactEditorWidget *createWidget( TDEABC::AddressBook *ab, TQWidget *parent,
const char *name )
150 return new ImageWidget( ab, parent, name );
153 TQString pageIdentifier()
const {
return "misc"; }