KDChartChart.h

Go to the documentation of this file.
00001 /****************************************************************************
00002  ** Copyright (C) 2007 Klaralvdalens Datakonsult AB.  All rights reserved.
00003  **
00004  ** This file is part of the KD Chart library.
00005  **
00006  ** This file may be distributed and/or modified under the terms of the
00007  ** GNU General Public License version 2 as published by the Free Software
00008  ** Foundation and appearing in the file LICENSE.GPL included in the
00009  ** packaging of this file.
00010  **
00011  ** Licensees holding valid commercial KD Chart licenses may use this file in
00012  ** accordance with the KD Chart Commercial License Agreement provided with
00013  ** the Software.
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  ** See http://www.kdab.net/kdchart for
00019  **   information about KDChart Commercial License Agreements.
00020  **
00021  ** Contact info@kdab.net if any conditions of this
00022  ** licensing are not clear to you.
00023  **
00024  **********************************************************************/
00025 
00026 #ifndef KDCHARTCHART_H
00027 #define KDCHARTCHART_H
00028 
00029 #include <QWidget>
00030 
00031 #include "kdchart_export.h"
00032 #include "KDChartGlobal.h"
00033 
00041 namespace KDChart {
00042 
00043     class BackgroundAttributes;
00044     class FrameAttributes;
00045     class AbstractDiagram;
00046     class AbstractCoordinatePlane;
00047     class HeaderFooter;
00048     class Legend;
00049 
00050     typedef QList<AbstractCoordinatePlane*> CoordinatePlaneList;
00051     typedef QList<HeaderFooter*> HeaderFooterList;
00052     typedef QList<Legend*> LegendList;
00053 
00054 
00072     class KDCHART_EXPORT Chart : public QWidget
00073     {
00074         Q_OBJECT
00075         Q_PROPERTY( int globalLeadingTop READ globalLeadingTop WRITE setGlobalLeadingTop )
00076         Q_PROPERTY( int globalLeadingBottom READ globalLeadingBottom WRITE setGlobalLeadingBottom )
00077         Q_PROPERTY( int globalLeadingLeft READ globalLeadingLeft WRITE setGlobalLeadingLeft )
00078         Q_PROPERTY( int globalLeadingRight READ globalLeadingRight WRITE setGlobalLeadingRight )
00079 
00080         KDCHART_DECLARE_PRIVATE_BASE_POLYMORPHIC_QWIDGET( Chart )
00081 
00082     public:
00083         explicit Chart ( QWidget* parent = 0 );
00084         ~Chart();
00085 
00098         void setFrameAttributes( const FrameAttributes &a );
00099         FrameAttributes frameAttributes() const;
00100 
00114         void setBackgroundAttributes( const BackgroundAttributes &a );
00115         BackgroundAttributes backgroundAttributes() const;
00116 
00124         AbstractCoordinatePlane* coordinatePlane();
00125 
00130         CoordinatePlaneList coordinatePlanes();
00131 
00138         void addCoordinatePlane( AbstractCoordinatePlane* plane );
00139 
00157         void replaceCoordinatePlane( AbstractCoordinatePlane* plane,
00158                                      AbstractCoordinatePlane* oldPlane = 0 );
00159 
00168         void takeCoordinatePlane( AbstractCoordinatePlane* plane );
00169 
00175         void setCoordinatePlaneLayout( QLayout * layout );
00176         QLayout* coordinatePlaneLayout();
00177 
00183         HeaderFooter* headerFooter();
00184 
00189         HeaderFooterList headerFooters();
00190 
00197         void addHeaderFooter( HeaderFooter* headerFooter );
00198 
00216         void replaceHeaderFooter ( HeaderFooter* headerFooter,
00217                                    HeaderFooter* oldHeaderFooter = 0 );
00218 
00227         void takeHeaderFooter( HeaderFooter* headerFooter );
00228 
00233         Legend* legend();
00234 
00239         LegendList legends();
00240 
00247         void addLegend( Legend* legend );
00248 
00272         void replaceLegend ( Legend* legend, Legend* oldLegend = 0 );
00273 
00282         void takeLegend( Legend* legend );
00283 
00303         void setGlobalLeading( int left, int top, int right, int bottom );
00304 
00312         void setGlobalLeadingLeft( int leading );
00313 
00322         int globalLeadingLeft() const;
00323 
00331         void setGlobalLeadingTop( int leading );
00332 
00341         int globalLeadingTop() const;
00342 
00350         void setGlobalLeadingRight( int leading );
00351 
00360         int globalLeadingRight() const;
00361 
00369         void setGlobalLeadingBottom( int leading );
00370 
00379         int globalLeadingBottom() const;
00380 
00394         void paint( QPainter* painter, const QRect& target );
00395 
00396         void reLayoutFloatingLegends();
00397 
00398     Q_SIGNALS:
00400         void propertiesChanged();
00401 
00402     protected:
00406         /* reimp */ void resizeEvent ( QResizeEvent * event );
00407 
00415         /* reimp */ void paintEvent( QPaintEvent* event );
00416 
00418         void mousePressEvent( QMouseEvent* event );
00420         void mouseDoubleClickEvent( QMouseEvent* event );
00422         void mouseMoveEvent( QMouseEvent* event );
00424         void mouseReleaseEvent( QMouseEvent* event );
00426         bool event( QEvent* event );
00427     };
00428 
00429 // Here we have a few docu block to be included into the API documentation:
00455 }
00521 #endif

Generated on Thu Mar 4 23:19:10 2010 for KD Chart 2 by  doxygen 1.5.4