1
/* This file is part of the KDE project
3
Copyright 2007-2008 Johannes Simon <johannes.simon@gmail.com>
4
Copyright 2010 Inge Wallin <inge@lysator.liu.se>
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Library General Public
8
License as published by the Free Software Foundation; either
9
version 2 of the License, or (at your option) any later version.
11
This library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Library General Public License for more details.
16
You should have received a copy of the GNU Library General Public License
17
along with this library; see the file COPYING.LIB. If not, write to
18
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19
* Boston, MA 02110-1301, USA.
22
#ifndef KCHART_LEGEND_H
23
#define KCHART_LEGEND_H
32
#include "ChartShape.h"
37
class CHARTSHAPELIB_EXPORT Legend : public QObject, public KoShape
42
Legend( ChartShape *parent );
45
QString title() const;
46
bool showFrame() const;
47
QPen framePen() const;
48
QColor frameColor() const;
49
QBrush backgroundBrush() const;
50
QColor backgroundColor() const;
52
qreal fontSize() const;
53
QFont titleFont() const;
54
qreal titleFontSize() const;
55
LegendExpansion expansion() const;
56
Qt::Alignment alignment() const;
57
Position legendPosition() const;
59
void setTitle( const QString &title );
60
void setShowFrame( bool show );
61
void setFramePen( const QPen &pen );
62
void setFrameColor( const QColor &color );
63
void setBackgroundBrush( const QBrush &brush );
64
void setBackgroundColor( const QColor &color );
65
void setFont( const QFont &font );
66
void setFontSize( qreal size );
67
void setTitleFont( const QFont &font );
68
void setTitleFontSize( qreal size );
69
void setExpansion( LegendExpansion expansion );
70
void setAlignment( Qt::Alignment alignment );
71
void setLegendPosition( Position position );
72
void setSize( const QSizeF &size );
74
void paint( QPainter &painter, const KoViewConverter &converter );
75
void paintPixmap( QPainter &painter, const KoViewConverter &converter );
77
bool loadOdf( const KoXmlElement &legendElement, KoShapeLoadingContext &context );
78
void saveOdf( KoShapeSavingContext &context ) const;
80
KDChart::Legend *kdLegend() const;
83
using KoShape::update;
87
void slotChartTypeChanged( ChartType chartType );
88
void slotKdLegendChanged();
97
#endif // KCHART_LEGEND_H