20#ifndef TOKENSTYLEELEMENT_H
21#define TOKENSTYLEELEMENT_H
23#include "kformuladefs.h"
24#include "sequenceelement.h"
26KFORMULA_NAMESPACE_BEGIN
43 ContextStyle::IndexStyle istyle,
44 StyleAttributes& style );
46 virtual void draw( TQPainter& painter, const LuPixelRect& r,
49 ContextStyle::IndexStyle istyle,
50 StyleAttributes& style,
51 const LuPixelPoint& parentOrigin );
55 virtual void writeMathMLAttributes( TQDomElement& element ) const ;
57 void setAbsoluteSize( double s, bool fontsize = false );
58 void setRelativeSize( double s, bool fontsize = false );
59 void setPixelSize( double s, bool fontsize = false );
61 void setCharStyle( CharStyle cs ) {
63 m_customMathVariant = true;
65 CharStyle charStyle() const { return m_charStyle; }
67 void setCharFamily( CharFamily cf ) {
69 m_customMathVariant = true;
71 CharFamily charFamily() const { return m_charFamily; }
73 void setMathColor( const TQColor& c ) {
75 m_customMathColor = true;
77 TQColor mathColor() const { return m_mathColor; }
79 void setMathBackground( const TQColor& bg ) {
80 m_mathBackground = bg;
81 m_customMathBackground = true;
83 TQColor mathBackground() const { return m_mathBackground; }
85 void setFontWeight( bool w ) {
87 m_customFontWeight = true;
89 bool fontWeight() const { return m_fontWeight; }
91 void setFontStyle( bool s ) {
93 m_customFontStyle = true;
95 bool fontStyle() const { return m_fontStyle; }
97 void setFontFamily( const TQString& s ) {
99 m_customFontFamily = true;
101 TQString fontFamily() const { return m_fontFamily; }
103 void setColor( const TQColor& c ) {
105 m_customColor = true;
107 TQColor color() const { return m_color; }
109 bool customMathVariant() const { return m_customMathVariant; }
110 bool customMathColor() const { return m_customMathColor; }
111 bool customMathBackground() const { return m_customMathBackground; }
112 bool customFontWeight() const { return m_customFontWeight; }
113 bool customFontStyle() const { return m_customFontStyle; }
114 bool customFontFamily() const { return m_customFontFamily; }
115 bool customColor() const { return m_customColor; }
117 virtual void setStyleSize( const ContextStyle& context, StyleAttributes& style );
125 void setStyleColor( StyleAttributes& style );
126 virtual void setStyleBackground( StyleAttributes& style );
128 virtual void resetStyle( StyleAttributes& style );
136 double sizeFactor( const ContextStyle& context, double factor );
139 SizeType m_mathSizeType;
141 CharStyle m_charStyle;
142 CharFamily m_charFamily;
144 TQColor m_mathBackground;
147 SizeType m_fontSizeType;
149 TQString m_fontFamily;
155 bool m_customMathVariant;
156 bool m_customMathColor;
157 bool m_customMathBackground;
160 bool m_customFontWeight;
161 bool m_customFontStyle;
162 bool m_customFontFamily;
166KFORMULA_NAMESPACE_END
Basis of every formula element.
Contains all the style information for the formela.
TextStyle Textstyles like in TeX.
The element that contains a number of children.
This class handles mathematical style attributes common to token elements, as explained in MathML Spe...
virtual void draw(TQPainter &painter, const LuPixelRect &r, const ContextStyle &context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes &style, const LuPixelPoint &parentOrigin) Draws the whole element including its children.
TQString getHtmlColor(const TQString &colorStr) Return RGB string from HTML Colors.
virtual void calcSizes(const ContextStyle &context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes &style) Calculates our width and height and our children's parentPosition.
virtual bool readAttributesFromMathMLDom(const TQDomElement &element) Reads our attributes from the MathML element.
virtual void setStyleVariant(StyleAttributes &style) Set the mathvariant related info in style stacks, including info for deprecated attributes.
|