21 #include "insertimagedialog.h"
22 #include "insertimagewidget.h"
24 #include <KLocalizedString>
28 namespace KPIMTextEdit {
30 class InsertImageDialogPrivate
33 InsertImageDialogPrivate( InsertImageDialog *qq )
36 q->setCaption( i18n(
"Insert Image" ) );
37 q->setButtons( KDialog::Ok|KDialog::Cancel );
38 q->setButtonText( KDialog::Ok, i18n(
"Insert" ) );
39 imageWidget =
new InsertImageWidget(q);
40 q->connect( imageWidget, SIGNAL(enableButtonOk(
bool)),
41 q, SLOT(enableButtonOk(
bool)) );
42 q->setMainWidget( imageWidget );
43 q->enableButtonOk(
false );
46 InsertImageWidget *imageWidget;
50 InsertImageDialog::InsertImageDialog(
QWidget *parent )
51 : KDialog( parent ), d( new InsertImageDialogPrivate( this ) )
55 InsertImageDialog::~InsertImageDialog()
60 int InsertImageDialog::imageWidth()
const
62 return d->imageWidget->imageWidth();
65 int InsertImageDialog::imageHeight()
const
67 return d->imageWidget->imageHeight();
70 void InsertImageDialog::setImageWidth(
int value )
72 d->imageWidget->setImageWidth( value );
75 void InsertImageDialog::setImageHeight(
int value )
77 d->imageWidget->setImageHeight( value );
80 KUrl InsertImageDialog::imageUrl()
const
82 return d->imageWidget->imageUrl();
85 void InsertImageDialog::setImageUrl(
const KUrl &url )
87 d->imageWidget->setImageUrl( url );
90 bool InsertImageDialog::keepOriginalSize()
const
92 return d->imageWidget->keepOriginalSize();