1
/* This file is part of the KDE project
3
* Copyright (C) 2007 Inge Wallin <inge@lysator.liu.se>
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Library General Public
7
* License as published by the Free Software Foundation; either
8
* version 2 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Library General Public License for more details.
15
* You should have received a copy of the GNU Library General Public License
16
* along with this library; see the file COPYING.LIB. If not, write to
17
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
* Boston, MA 02110-1301, USA.
22
#ifndef KCHART_CHARTTOOL_H
23
#define KCHART_CHARTTOOL_H
26
#include <KoToolBase.h>
29
#include "ChartShape.h"
40
* This is the tool for the chart shape, which is a flake-based plugin.
43
class CHARTSHAPELIB_EXPORT ChartTool : public KoToolBase
47
explicit ChartTool(KoCanvasBase *canvas);
50
/// reimplemented from superclass
51
virtual void paint( QPainter &painter, const KoViewConverter &converter );
53
/// reimplemented from superclass
54
virtual void mousePressEvent( KoPointerEvent *event ) ;
55
/// reimplemented from superclass
56
virtual void mouseMoveEvent( KoPointerEvent *event );
57
/// reimplemented from superclass
58
virtual void mouseReleaseEvent( KoPointerEvent *event );
59
/// reimplemented from superclass
60
virtual void activate(ToolActivation toolActivation, const QSet<KoShape*> &shapes);
61
/// reimplemented from superclass
62
virtual void deactivate();
63
/// reimplemented from superclass
64
virtual QWidget *createOptionWidget();
67
void setChartType( ChartType type, ChartSubtype subtype = NoChartSubtype );
68
void setChartSubType( ChartSubtype subtype );
69
void setThreeDMode( bool threeD );
70
void setDataDirection( Qt::Orientation );
71
void setShowTitle( bool show );
72
void setShowSubTitle( bool show );
73
void setShowFooter( bool show );
76
void setDataSetXDataRegion( DataSet *dataSet, const CellRegion ®ion );
77
void setDataSetYDataRegion( DataSet *dataSet, const CellRegion ®ion );
78
void setDataSetCustomDataRegion( DataSet *dataSet, const CellRegion ®ion );
79
void setDataSetLabelDataRegion( DataSet *dataSet, const CellRegion ®ion );
80
void setDataSetCategoryDataRegion( DataSet *dataSet, const CellRegion ®ion );
82
void setDataSetChartType( DataSet *dataSet, ChartType type );
83
void setDataSetChartSubType( DataSet *dataSet, ChartSubtype subType );
84
void setDataSetShowValues( DataSet *dataSet, bool b );
85
void setDataSetShowLabels( DataSet *dataSet, bool b );
86
void setDataSetPen( DataSet *dataSet, const QColor& color );
87
void setDataSetBrush( DataSet *dataSet, const QColor& color );
88
void setDataSetAxis( DataSet *dataSet, Axis *axis );
91
void setGapBetweenBars( int percent );
92
void setGapBetweenSets( int percent );
93
void setPieExplodeFactor( DataSet *dataSet, int percent );
96
void addAxis( AxisDimension, const QString& title = "" );
97
void removeAxis( Axis *axis );
98
void setAxisShowTitle( Axis *axis, bool show );
99
void setAxisTitle( Axis *axis, const QString& title );
100
void setAxisShowGridLines( Axis *axis, bool b = true );
101
void setAxisUseLogarithmicScaling(Axis *axis, bool b = true );
102
void setAxisStepWidth( Axis *axis, qreal width );
103
void setAxisSubStepWidth( Axis *axis, qreal width );
104
void setAxisUseAutomaticStepWidth( Axis *axis, bool automatic);
105
void setAxisUseAutomaticSubStepWidth( Axis *axis, bool automatic );
108
void setShowLegend( bool b );
109
void setLegendTitle( const QString& title );
110
void setLegendFont( const QFont& font );
111
void setLegendFontSize( int size );
112
void setLegendOrientation( Qt::Orientation );
113
void setLegendAlignment( Qt::Alignment );
114
void setLegendFixedPosition( Position position );
115
void setLegendBackgroundColor( const QColor& color );
116
void setLegendFrameColor( const QColor& color );
117
void setLegendShowFrame( bool show );
119
// Called upon shape manager's selectionChanged() signal
120
void shapeSelectionChanged();
127
} // namespace KChart
130
#endif // KCHART_CHARTTOOL_H