KD Reports 1.4
KDReportsChartElement.h
00001 /****************************************************************************
00002 ** Copyright (C) 2007-2012 Klaralvdalens Datakonsult AB.  All rights reserved.
00003 **
00004 ** This file is part of the KD Reports library.
00005 **
00006 ** Licensees holding valid commercial KD Reports licenses may use this file in
00007 ** accordance with the KD Reports Commercial License Agreement provided with
00008 ** the Software.
00009 **
00010 **
00011 ** This file may be distributed and/or modified under the terms of the
00012 ** GNU General Public License version 2 and version 3 as published by the
00013 ** Free Software Foundation and appearing in the file LICENSE.GPL included.
00014 **
00015 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00016 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00017 **
00018 ** Contact info@kdab.com if any conditions of this licensing are not
00019 ** clear to you.
00020 **
00021 **********************************************************************/
00022 
00023 #ifndef KDREPORTSCHARTELEMENT_H
00024 #define KDREPORTSCHARTELEMENT_H
00025 
00026 #include <QSharedDataPointer>
00027 #include "KDReportsElement.h"
00028 #include "KDReportsUnit.h"
00029 #include <QtCore/QtGlobal> // qreal
00030 #include <QSizeF>
00031 class QAbstractItemModel;
00032 
00033 namespace KDChart { class Chart; }
00034 
00035 namespace KDReports {
00036 
00041 class KDREPORTS_EXPORT ChartElement : public Element
00042 {
00043 public:
00047     explicit ChartElement( QAbstractItemModel* tableModel );
00048 
00054     explicit ChartElement( const QString& modelKey );
00055 
00064     explicit ChartElement( KDChart::Chart* chart );
00065 
00069     virtual ~ChartElement();
00070 
00074     ChartElement(const ChartElement &other);
00078     ChartElement &operator=(const ChartElement &other);
00079 
00089     void setChart( KDChart::Chart* chart );
00090 
00101     void setSize( qreal width, qreal height, Unit unit = Millimeters );
00102 
00107     QSizeF size() const;
00108 
00113     Unit unit() const;
00114 
00119     void setTableModel(QAbstractItemModel *tableModel);
00120 
00125     void setModelKey(const QString &modelKey);
00126 
00131     void build( ReportBuilder& ) const;
00136     Element* clone() const;
00137 
00138 private:
00139     class Private;
00140     QSharedDataPointer<Private> d;
00141 };
00142 
00143 }
00144 
00145 #endif /* KDREPORTSCHARTELEMENT_H */
 All Classes Namespaces Functions Enumerations Enumerator

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