~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to plugins/chartshape/Legend.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 2007-2008 Johannes Simon <johannes.simon@gmail.com>
 
4
   Copyright 2010      Inge Wallin <inge@lysator.liu.se>
 
5
 
 
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.
 
10
 
 
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.
 
15
 
 
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.
 
20
*/
 
21
 
 
22
#ifndef KCHART_LEGEND_H
 
23
#define KCHART_LEGEND_H
 
24
 
 
25
// Qt
 
26
#include <QObject>
 
27
 
 
28
// KOffice
 
29
#include <KoShape.h>
 
30
 
 
31
// KChart
 
32
#include "ChartShape.h"
 
33
 
 
34
 
 
35
namespace KChart {
 
36
 
 
37
class CHARTSHAPELIB_EXPORT Legend : public QObject, public KoShape
 
38
{
 
39
    Q_OBJECT
 
40
 
 
41
public:
 
42
    Legend( ChartShape *parent );
 
43
    ~Legend();
 
44
 
 
45
    QString title() const;
 
46
    bool showFrame() const;
 
47
    QPen framePen() const;
 
48
    QColor frameColor() const;
 
49
    QBrush backgroundBrush() const;
 
50
    QColor backgroundColor() const;
 
51
    QFont font() 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;
 
58
 
 
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 );
 
73
 
 
74
    void paint( QPainter &painter, const KoViewConverter &converter );
 
75
    void paintPixmap( QPainter &painter, const KoViewConverter &converter );
 
76
 
 
77
    bool loadOdf( const KoXmlElement &legendElement, KoShapeLoadingContext &context );
 
78
    void saveOdf( KoShapeSavingContext &context ) const;
 
79
 
 
80
    KDChart::Legend *kdLegend() const;
 
81
 
 
82
    void rebuild();
 
83
    using KoShape::update;
 
84
    void update() const;
 
85
 
 
86
private slots:
 
87
    void slotChartTypeChanged( ChartType chartType );
 
88
    void slotKdLegendChanged();
 
89
 
 
90
private:
 
91
    class Private;
 
92
    Private *const d;
 
93
};
 
94
 
 
95
}
 
96
 
 
97
#endif // KCHART_LEGEND_H
 
98