-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMmlTextNode.h
49 lines (40 loc) · 1.03 KB
/
MmlTextNode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef MMLTEXTNODE_H
#define MMLTEXTNODE_H
#include "MmlTokenNode.h"
#include "MmlDocument.h"
#include <QRegularExpression>
class MmlTextNode : public MmlNode
{
public:
MmlTextNode( const QString &text, MmlDocument *document );
virtual QString toStr() const;
QString text() const
{
return m_text;
}
// TextNodes are not xml elements, so they can't have attributes of
// their own. Everything is taken from the parent.
virtual QFont font() const
{
return parent()->font();
}
virtual int scriptlevel( const MmlNode* = 0 ) const
{
return parent()->scriptlevel( this );
}
virtual QColor color() const
{
return parent()->color();
}
virtual QColor background() const
{
return parent()->background();
}
protected:
virtual void paintSymbol( QPainter *painter, double x_scaling, double y_scaling ) const;
virtual QRectF symbolRect() const;
QString m_text;
private:
bool isInvisibleOperator() const;
};
#endif//MMLTEXTNODE_H