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 setFirstRowIsLabel( bool b );
72
void setFirstColumnIsLabel( bool b );
73
void setShowTitle( bool show );
74
void setShowSubTitle( bool show );
75
void setShowFooter( bool show );
78
void setDataSetXDataRegion( DataSet *dataSet, const QString ®ion );
79
void setDataSetYDataRegion( DataSet *dataSet, const QString ®ion );
80
void setDataSetCustomDataRegion( DataSet *dataSet, const QString ®ion );
81
void setDataSetLabelDataRegion( DataSet *dataSet, const QString ®ion );
82
void setDataSetCategoryDataRegion( DataSet *dataSet, const QString ®ion );
84
void setDataSetChartType( DataSet *dataSet, ChartType type );
85
void setDataSetChartSubType( DataSet *dataSet, ChartSubtype subType );
86
void setDataSetShowValues( DataSet *dataSet, bool b );
87
void setDataSetShowLabels( DataSet *dataSet, bool b );
88
void setDataSetColor( DataSet *dataSet, const QColor& color );
89
void setDataSetAxis( DataSet *dataSet, Axis *axis );
92
void setGapBetweenBars( int percent );
93
void setGapBetweenSets( int percent );
94
void setPieExplodeFactor( DataSet *dataSet, int percent );
97
void addAxis( AxisPosition, const QString& title = "" );
98
void removeAxis( Axis *axis );
99
void setAxisShowTitle( Axis *axis, bool show );
100
void setAxisTitle( Axis *axis, const QString& title );
101
void setAxisShowGridLines( Axis *axis, bool b = true );
102
void setAxisUseLogarithmicScaling(Axis *axis, bool b = true );
103
void setAxisStepWidth( Axis *axis, qreal width );
104
void setAxisSubStepWidth( Axis *axis, qreal width );
105
void setAxisUseAutomaticStepWidth( Axis *axis, bool automatic);
106
void setAxisUseAutomaticSubStepWidth( Axis *axis, bool automatic );
109
void setShowLegend( bool b );
110
void setLegendTitle( const QString& title );
111
void setLegendFont( const QFont& font );
112
void setLegendFontSize( int size );
113
void setLegendOrientation( Qt::Orientation );
114
void setLegendAlignment( Qt::Alignment );
115
void setLegendFixedPosition( LegendPosition position );
116
void setLegendBackgroundColor( const QColor& color );
117
void setLegendFrameColor( const QColor& color );
118
void setLegendShowFrame( bool show );
120
// Called upon shape manager's selectionChanged() signal
121
void shapeSelectionChanged();
128
} // namespace KChart
131
#endif // KCHART_CHARTTOOL_H