KD Reports  1.5
 All Classes Namespaces Functions Enumerations Enumerator Pages
KDReportsImageElement.h
1 /****************************************************************************
2 ** Copyright (C) 2007-2014 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 
37 class KDREPORTS_EXPORT ImageElement : public Element
38 {
39 public:
44  explicit ImageElement( const QPixmap& pixmap );
50  explicit ImageElement( const QImage& image );
54  virtual ~ImageElement();
55 
60  void setPixmap( const QPixmap& pixmap );
61 
66  QPixmap pixmap() const;
67 
72  void setImage( const QImage& image );
73 
78  QImage image() const;
79 
83  ImageElement(const ImageElement &other);
87  ImageElement &operator=(const ImageElement &other);
88 
105  void setWidth( qreal width, Unit unit = Millimeters );
106 
111  qreal width() const;
112 
119  void setHeight( qreal height, Unit unit = Millimeters );
120 
125  qreal height() const;
126 
131  Unit unit() const;
132 
137  void setUnit(Unit unit);
138 
145  void setFitToPage();
146 
151  bool fitToPage() const;
152 
157  void setId( const QString& id );
158 
163  QString id() const;
164 
169  void build( ReportBuilder& ) const;
174  Element* clone() const;
175 
176 private:
177  class Private;
178  Private* const d;
179 };
180 
181 }
182 
183 #endif /* KDREPORTSIMAGEELEMENT_H */
184 
Unit
Definition: KDReportsUnit.h:32
Definition: KDReportsImageElement.h:37
Millimeters (the default)
Definition: KDReportsUnit.h:33
Definition: KDReportsElement.h:41

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