~ubuntu-branches/ubuntu/oneiric/qwt/oneiric-proposed

« back to all changes in this revision

Viewing changes to qwt-5.0.2/textengines/mathml/qwt_mathml_text_engine.h

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2007-10-05 15:20:41 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071005152041-qmybqh4fj9jejyo2
Tags: 5.0.2-2
* Handle nostrip build option. (Closes: #437877)
* Build libqwt5-doc package in binary-indep target. (Closes: #443110)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
 
2
 * Qwt Widget Library
 
3
 * Copyright (C) 1997   Josef Wilgen
 
4
 * Copyright (C) 2003   Uwe Rathmann
 
5
 *
 
6
 * This library is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the Qwt License, Version 1.0
 
8
 *****************************************************************************/
 
9
 
 
10
// vim: expandtab
 
11
 
 
12
#ifndef QWT_MATHML_TEXT_ENGINE_H
 
13
#define QWT_MATHML_TEXT_ENGINE_H 1
 
14
 
 
15
#if QT_VERSION >= 0x040000
 
16
 
 
17
#include "qwt_text_engine.h"
 
18
 
 
19
/*!
 
20
  \brief Text Engine for the MathML renderer of the Qt solutions package.
 
21
 
 
22
  The Qt Solution package includes a renderer for MathML 
 
23
  http://www.trolltech.com/products/qt/addon/solutions/catalog/4/Widgets/qtmmlwidget 
 
24
  that is available for owners of a commercial Qt license.
 
25
  You need a version >= 2.1, that is only available for Qt4.
 
26
 
 
27
  To enable MathML support the following code needs to be added to the
 
28
  application:
 
29
  \verbatim
 
30
#include <qwt_mathml_text_engine.h>
 
31
 
 
32
QwtText::setTextEngine(QwtText::MathMLText, new QwtMathMLTextEngine());
 
33
  \endverbatim
 
34
 
 
35
  \sa QwtTextEngine, QwtText::setTextEngine
 
36
  \warning Unfortunately the MathML renderer doesn't support rotating of texts. 
 
37
*/
 
38
 
 
39
class QWT_EXPORT QwtMathMLTextEngine: public QwtTextEngine
 
40
{
 
41
public:
 
42
    QwtMathMLTextEngine();
 
43
    virtual ~QwtMathMLTextEngine();
 
44
 
 
45
    virtual int heightForWidth(const QFont &font, int flags, 
 
46
        const QString &text, int width) const;
 
47
 
 
48
    virtual QSize textSize(const QFont &font, int flags,
 
49
        const QString &text) const;
 
50
 
 
51
    virtual void draw(QPainter *painter, const QRect &rect,
 
52
        int flags, const QString &text) const;
 
53
 
 
54
    virtual bool mightRender(const QString &) const;
 
55
 
 
56
    virtual void textMargins(const QFont &, const QString &,
 
57
        int &left, int &right, int &top, int &bottom) const;
 
58
};
 
59
 
 
60
#endif // QT_VERSION >= 0x040000
 
61
 
 
62
#endif