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
00170
00171 void setCoordinatePlaneLayout( QLayout * layout );
00172 QLayout* coordinatePlaneLayout();
00173
00179 HeaderFooter* headerFooter();
00180
00185 HeaderFooterList headerFooters();
00186
00193 void addHeaderFooter( HeaderFooter* headerFooter );
00194
00212 void replaceHeaderFooter ( HeaderFooter* headerFooter,
00213 HeaderFooter* oldHeaderFooter = 0 );
00214
00223 void takeHeaderFooter( HeaderFooter* headerFooter );
00224
00229 Legend* legend();
00230
00235 LegendList legends();
00236
00243 void addLegend( Legend* legend );
00244
00268 void replaceLegend ( Legend* legend, Legend* oldLegend = 0 );
00269
00278 void takeLegend( Legend* legend );
00279
00299 void setGlobalLeading( int left, int top, int right, int bottom );
00300
00308 void setGlobalLeadingLeft( int leading );
00309
00318 int globalLeadingLeft() const;
00319
00327 void setGlobalLeadingTop( int leading );
00328
00337 int globalLeadingTop() const;
00338
00346 void setGlobalLeadingRight( int leading );
00347
00356 int globalLeadingRight() const;
00357
00365 void setGlobalLeadingBottom( int leading );
00366
00375 int globalLeadingBottom() const;
00376
00390 void paint( QPainter* painter, const QRect& target );
00391
00392 void reLayoutFloatingLegends();
00393
00394 Q_SIGNALS:
00396 void propertiesChanged();
00397
00398 protected:
00402 void resizeEvent ( QResizeEvent * event );
00403
00411 void paintEvent( QPaintEvent* event );
00412
00414 void mousePressEvent( QMouseEvent* event );
00415 };
00416
00417
00443 }
00487 #endif