• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

KPIMTextedit Library

  • kpimtextedit
insertimagedialog.cpp
1 /*
2  Copyright (c) 2012 Montel Laurent <montel@kde.org>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 
19 */
20 
21 #include "insertimagedialog.h"
22 #include "insertimagewidget.h"
23 #include <KLocale>
24 #include <KUrlRequester>
25 #include <KImageIO>
26 #include <KFileDialog>
27 
28 #include <QVBoxLayout>
29 #include <QHBoxLayout>
30 #include <QLabel>
31 #include <QSpinBox>
32 #include <QCheckBox>
33 #include <KLineEdit>
34 
35 namespace KPIMTextEdit {
36 
37 class InsertImageDialogPrivate
38 {
39 public:
40  InsertImageDialogPrivate(InsertImageDialog *qq)
41  :q( qq )
42  {
43  q->setCaption( i18n( "Insert Image" ) );
44  q->setButtons( KDialog::Ok|KDialog::Cancel );
45  q->setButtonText( KDialog::Ok, i18n( "Insert" ) );
46  imageWidget = new InsertImageWidget(q);
47  q->connect(imageWidget,SIGNAL(enableButtonOk(bool)),q,SLOT(enableButtonOk(bool)));
48  q->setMainWidget( imageWidget );
49  q->enableButtonOk( false );
50  }
51 
52  InsertImageWidget *imageWidget;
53  InsertImageDialog *q;
54 };
55 
56 InsertImageDialog::InsertImageDialog(QWidget *parent)
57  :KDialog( parent ), d( new InsertImageDialogPrivate( this ) )
58 {
59 }
60 
61 InsertImageDialog::~InsertImageDialog()
62 {
63  delete d;
64 }
65 
66 int InsertImageDialog::imageWidth() const
67 {
68  return d->imageWidget->imageWidth();
69 }
70 
71 int InsertImageDialog::imageHeight() const
72 {
73  return d->imageWidget->imageHeight();
74 }
75 
76 void InsertImageDialog::setImageWidth(int value)
77 {
78  d->imageWidget->setImageWidth( value );
79 }
80 
81 void InsertImageDialog::setImageHeight(int value)
82 {
83  d->imageWidget->setImageHeight( value );
84 }
85 
86 KUrl InsertImageDialog::imageUrl() const
87 {
88  return d->imageWidget->imageUrl();
89 }
90 
91 void InsertImageDialog::setImageUrl(const KUrl&url)
92 {
93  d->imageWidget->setImageUrl( url );
94 }
95 
96 bool InsertImageDialog::keepOriginalSize() const
97 {
98  return d->imageWidget->keepOriginalSize();
99 }
100 
101 }
102 
103 #include "moc_insertimagedialog.cpp"
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:26:01 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KPIMTextedit Library

Skip menu "KPIMTextedit Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal