3
$Id: KDChartTextPiece.h,v 1.3.2.1 2001/12/08 12:15:41 khz Exp $
5
KDChart - a multi-platform charting engine
7
Copyright (C) 2001 by Klar�lvdalens Datakonsult AB
2
KDChart - a multi-platform charting engine
5
/****************************************************************************
6
** Copyright (C) 2001-2003 Klar�lvdalens Datakonsult AB. All rights reserved.
8
** This file is part of the KDChart library.
10
** This file may be distributed and/or modified under the terms of the
11
** GNU General Public License version 2 as published by the Free Software
12
** Foundation and appearing in the file LICENSE.GPL included in the
13
** packaging of this file.
15
** Licensees holding valid commercial KDChart licenses may use this file in
16
** accordance with the KDChart Commercial License Agreement provided with
19
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22
** See http://www.klaralvdalens-datakonsult.se/?page=products for
23
** information about KDChart Commercial License Agreements.
25
** Contact info@klaralvdalens-datakonsult.se if any conditions of this
26
** licensing are not clear to you.
28
**********************************************************************/
10
29
#ifndef __KDCHARTTEXTPIECE_H__
11
30
#define __KDCHARTTEXTPIECE_H__
23
42
class KDChartTextPiece
26
KDChartTextPiece( const QString& text, const QFont& font );
27
KDChartTextPiece( const KDChartTextPiece& src );
28
KDChartTextPiece& operator=( const KDChartTextPiece& src );
29
virtual ~KDChartTextPiece();
31
virtual int width() const;
32
virtual int height() const;
33
virtual int fontLeading() const;
35
virtual void draw( QPainter *p, int x, int y, const QRegion& clipRegion,
36
const QColor& color, const QBrush* paper = 0 ) const;
40
bool isRichText() const;
44
QSimpleRichText* _richText; // used when _isRichText == true
45
QString _text; // used when _isRichText == false
46
QFont _font; // used when _isRichText == false
47
QFontMetrics* _metrics;
45
KDChartTextPiece( const QString& text, const QFont& font );
46
KDChartTextPiece( const KDChartTextPiece& src );
47
KDChartTextPiece& operator=( const KDChartTextPiece& src );
48
virtual ~KDChartTextPiece();
50
virtual int width() const;
51
virtual int height() const;
52
virtual int fontLeading() const;
54
virtual void draw( QPainter *p, int x, int y, const QRect& clipRect,
55
const QColor& color, const QBrush* paper = 0 ) const;
56
virtual void draw( QPainter *p, int x, int y, const QRegion& clipRegion,
57
const QColor& color, const QBrush* paper = 0 ) const;
61
bool isRichText() const;
65
QSimpleRichText* _richText; // used when _isRichText == true
66
QString _text; // used when _isRichText == false
67
QFont _font; // used when _isRichText == false
68
QFontMetrics* _metrics;