1
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
3
* Copyright (C) 1997 Josef Wilgen
4
* Copyright (C) 2003 Uwe Rathmann
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
*****************************************************************************/
12
#ifndef QWT_MATHML_TEXT_ENGINE_H
13
#define QWT_MATHML_TEXT_ENGINE_H 1
15
#if QT_VERSION >= 0x040000
17
#include "qwt_text_engine.h"
20
\brief Text Engine for the MathML renderer of the Qt solutions package.
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.
27
To enable MathML support the following code needs to be added to the
30
#include <qwt_mathml_text_engine.h>
32
QwtText::setTextEngine(QwtText::MathMLText, new QwtMathMLTextEngine());
35
\sa QwtTextEngine, QwtText::setTextEngine
36
\warning Unfortunately the MathML renderer doesn't support rotating of texts.
39
class QWT_EXPORT QwtMathMLTextEngine: public QwtTextEngine
42
QwtMathMLTextEngine();
43
virtual ~QwtMathMLTextEngine();
45
virtual int heightForWidth(const QFont &font, int flags,
46
const QString &text, int width) const;
48
virtual QSize textSize(const QFont &font, int flags,
49
const QString &text) const;
51
virtual void draw(QPainter *painter, const QRect &rect,
52
int flags, const QString &text) const;
54
virtual bool mightRender(const QString &) const;
56
virtual void textMargins(const QFont &, const QString &,
57
int &left, int &right, int &top, int &bottom) const;
60
#endif // QT_VERSION >= 0x040000