~ubuntu-branches/ubuntu/breezy/koffice/breezy

« back to all changes in this revision

Viewing changes to kchart/kdchart/KDChartTextPiece.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Burton
  • Date: 2004-05-09 11:33:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040509113300-vfrdadqsvjfuhn3b
Tags: 1:1.3.1-1
* New upstream bugfix release.
* Built against newer imagemagick (closes: #246623).
* Made koffice-libs/kformula recommend/depend on latex-xft-fonts, which
  provides mathematical fonts that the formula editor can use.  Also
  patched the kformula part to make these fonts the default.
* Changed kword menu hint from "WordProcessors" to "Word processors"
  (closes: #246209).
* Spellchecker configuration is now fixed (closes: #221256, #227568).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- Mode: C++ -*-
2
 
 
3
 
  $Id: KDChartTextPiece.h,v 1.3.2.1 2001/12/08 12:15:41 khz Exp $
4
 
 
5
 
  KDChart - a multi-platform charting engine
6
 
 
7
 
  Copyright (C) 2001 by Klar�lvdalens Datakonsult AB
8
 
*/
9
 
 
 
2
   KDChart - a multi-platform charting engine
 
3
   */
 
4
 
 
5
/****************************************************************************
 
6
 ** Copyright (C) 2001-2003 Klar�lvdalens Datakonsult AB.  All rights reserved.
 
7
 **
 
8
 ** This file is part of the KDChart library.
 
9
 **
 
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.
 
14
 **
 
15
 ** Licensees holding valid commercial KDChart licenses may use this file in
 
16
 ** accordance with the KDChart Commercial License Agreement provided with
 
17
 ** the Software.
 
18
 **
 
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.
 
21
 **
 
22
 ** See http://www.klaralvdalens-datakonsult.se/?page=products for
 
23
 **   information about KDChart Commercial License Agreements.
 
24
 **
 
25
 ** Contact info@klaralvdalens-datakonsult.se if any conditions of this
 
26
 ** licensing are not clear to you.
 
27
 **
 
28
 **********************************************************************/
10
29
#ifndef __KDCHARTTEXTPIECE_H__
11
30
#define __KDCHARTTEXTPIECE_H__
12
31
 
22
41
 
23
42
class KDChartTextPiece
24
43
{
25
 
public:
26
 
    KDChartTextPiece( const QString& text, const QFont& font );
27
 
    KDChartTextPiece( const KDChartTextPiece& src );
28
 
    KDChartTextPiece& operator=( const KDChartTextPiece& src );
29
 
    virtual ~KDChartTextPiece();
30
 
 
31
 
    virtual int width() const;
32
 
    virtual int height() const;
33
 
    virtual int fontLeading() const;
34
 
    
35
 
    virtual void draw( QPainter *p, int x, int y, const QRegion& clipRegion,
36
 
                       const QColor& color, const QBrush* paper = 0 ) const;
37
 
 
38
 
    QString text() const;
39
 
    QFont font() const;
40
 
    bool isRichText() const;
41
 
 
42
 
protected:
43
 
    bool _isRichText;
44
 
    QSimpleRichText* _richText; // used when _isRichText == true
45
 
    QString _text; // used when _isRichText == false
46
 
    QFont _font; // used when _isRichText == false
47
 
    QFontMetrics* _metrics;
 
44
    public:
 
45
        KDChartTextPiece( const QString& text, const QFont& font );
 
46
        KDChartTextPiece( const KDChartTextPiece& src );
 
47
        KDChartTextPiece& operator=( const KDChartTextPiece& src );
 
48
        virtual ~KDChartTextPiece();
 
49
 
 
50
        virtual int width() const;
 
51
        virtual int height() const;
 
52
        virtual int fontLeading() const;
 
53
 
 
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;
 
58
 
 
59
        QString text() const;
 
60
        QFont font() const;
 
61
        bool isRichText() const;
 
62
 
 
63
    protected:
 
64
        bool _isRichText;
 
65
        QSimpleRichText* _richText; // used when _isRichText == true
 
66
        QString _text; // used when _isRichText == false
 
67
        QFont _font; // used when _isRichText == false
 
68
        QFontMetrics* _metrics;
48
69
};
49
70
 
50
71
#endif