~ubuntu-branches/ubuntu/oneiric/koffice/oneiric-updates

« back to all changes in this revision

Viewing changes to plugins/chartshape/ChartTool.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the KDE project
 
2
 *
 
3
 * Copyright (C) 2007      Inge Wallin  <inge@lysator.liu.se>
 
4
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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.
 
19
 */
 
20
 
 
21
 
 
22
#ifndef KCHART_CHARTTOOL_H
 
23
#define KCHART_CHARTTOOL_H
 
24
 
 
25
// KOffice
 
26
#include <KoToolBase.h>
 
27
 
 
28
// KChart
 
29
#include "ChartShape.h"
 
30
 
 
31
 
 
32
class QAction;
 
33
 
 
34
 
 
35
namespace KChart
 
36
{
 
37
 
 
38
 
 
39
/**
 
40
 * This is the tool for the chart shape, which is a flake-based plugin.
 
41
 */
 
42
 
 
43
class CHARTSHAPELIB_EXPORT ChartTool : public KoToolBase
 
44
{
 
45
    Q_OBJECT
 
46
public:
 
47
    explicit ChartTool(KoCanvasBase *canvas);
 
48
    ~ChartTool();
 
49
 
 
50
    /// reimplemented from superclass
 
51
    virtual void paint( QPainter &painter, const KoViewConverter &converter );
 
52
 
 
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();
 
65
 
 
66
private slots:
 
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 );
 
74
 
 
75
    // Datasets
 
76
    void setDataSetXDataRegion( DataSet *dataSet, const CellRegion &region );
 
77
    void setDataSetYDataRegion( DataSet *dataSet, const CellRegion &region );
 
78
    void setDataSetCustomDataRegion( DataSet *dataSet, const CellRegion &region );
 
79
    void setDataSetLabelDataRegion( DataSet *dataSet, const CellRegion &region );
 
80
    void setDataSetCategoryDataRegion( DataSet *dataSet, const CellRegion &region );
 
81
    
 
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 );
 
89
    
 
90
    // Plot Area
 
91
    void setGapBetweenBars( int percent );
 
92
    void setGapBetweenSets( int percent );
 
93
    void setPieExplodeFactor( DataSet *dataSet, int percent );
 
94
    
 
95
    // Axes
 
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 );
 
106
 
 
107
    // Legend
 
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 );
 
118
 
 
119
    // Called upon shape manager's selectionChanged() signal
 
120
    void shapeSelectionChanged();
 
121
 
 
122
private:
 
123
    class Private;
 
124
    Private * const d;
 
125
};
 
126
 
 
127
} // namespace KChart
 
128
 
 
129
 
 
130
#endif // KCHART_CHARTTOOL_H