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

« back to all changes in this revision

Viewing changes to kchart/shape/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 setFirstRowIsLabel( bool b );
72
 
    void setFirstColumnIsLabel( bool b );
73
 
    void setShowTitle( bool show );
74
 
    void setShowSubTitle( bool show );
75
 
    void setShowFooter( bool show );
76
 
 
77
 
    // Datasets
78
 
    void setDataSetXDataRegion( DataSet *dataSet, const QString &region );
79
 
    void setDataSetYDataRegion( DataSet *dataSet, const QString &region );
80
 
    void setDataSetCustomDataRegion( DataSet *dataSet, const QString &region );
81
 
    void setDataSetLabelDataRegion( DataSet *dataSet, const QString &region );
82
 
    void setDataSetCategoryDataRegion( DataSet *dataSet, const QString &region );
83
 
    
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 );
90
 
    
91
 
    // Plot Area
92
 
    void setGapBetweenBars( int percent );
93
 
    void setGapBetweenSets( int percent );
94
 
    void setPieExplodeFactor( DataSet *dataSet, int percent );
95
 
    
96
 
    // Axes
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 );
107
 
 
108
 
    // Legend
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 );
119
 
 
120
 
    // Called upon shape manager's selectionChanged() signal
121
 
    void shapeSelectionChanged();
122
 
 
123
 
private:
124
 
    class Private;
125
 
    Private * const d;
126
 
};
127
 
 
128
 
} // namespace KChart
129
 
 
130
 
 
131
 
#endif // KCHART_CHARTTOOL_H