KD Reports  1.7
KDReportsImageElement.h
1 /****************************************************************************
2 ** Copyright (C) 2007-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Reports library.
5 **
6 ** Licensees holding valid commercial KD Reports licenses may use this file in
7 ** accordance with the KD Reports Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU Lesser General Public License version 2.1 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.com if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 
23 #ifndef KDREPORTSIMAGEELEMENT_H
24 #define KDREPORTSIMAGEELEMENT_H
25 
26 #include "KDReportsElement.h"
27 #include "KDReportsUnit.h"
28 #include <QtCore/QtGlobal> // qreal
29 class QPixmap;
30 class QImage;
31 
32 namespace KDReports {
33 class ImageElementPrivate;
34 
38 class KDREPORTS_EXPORT ImageElement : public Element
39 {
40 public:
45  explicit ImageElement( const QPixmap& pixmap );
51  explicit ImageElement( const QImage& image );
55  virtual ~ImageElement();
56 
61  void setPixmap( const QPixmap& pixmap );
62 
67  QPixmap pixmap() const;
68 
73  void setImage( const QImage& image );
74 
79  QImage image() const;
80 
84  ImageElement(const ImageElement &other);
88  ImageElement &operator=(const ImageElement &other);
89 
106  void setWidth( qreal width, Unit unit = Millimeters );
107 
112  qreal width() const;
113 
120  void setHeight( qreal height, Unit unit = Millimeters );
121 
126  qreal height() const;
127 
132  Unit unit() const;
133 
138  void setUnit(Unit unit);
139 
146  void setFitToPage();
147 
152  bool fitToPage() const;
153 
158  void setId( const QString& id );
159 
164  QString id() const;
165 
170  void build( ReportBuilder& ) const;
175  Element* clone() const;
176 
177 private:
178  ImageElementPrivate* const d;
179 };
180 
181 }
182 
183 #endif /* KDREPORTSIMAGEELEMENT_H */
184 
Unit
Definition: KDReportsUnit.h:32
Definition: KDReportsImageElement.h:38
Millimeters (the default)
Definition: KDReportsUnit.h:33
Definition: KDReportsAbstractTableElement.h:33
Definition: KDReportsElement.h:42

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-reports/