00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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 void resizeEvent ( QResizeEvent * event );
00407
00415 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
00455 }
00521 #endif