lib

TokenStyleElement Class Reference

#include <tokenstyleelement.h>

Inheritance diagram for TokenStyleElement:

SequenceElement BasicElement

List of all members.


Detailed Description

This class handles mathematical style attributes common to token elements, as explained in MathML Spec, Section 3.2.2.

It is in charge of reading and saving elements' attributes and setting rendering information according to these attributes.

Definition at line 35 of file tokenstyleelement.h.


Public Member Functions

 TokenStyleElement (BasicElement *parent=0)
virtual void calcSizes (const ContextStyle &context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes &style)
virtual void draw (QPainter &painter, const LuPixelRect &r, const ContextStyle &context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes &style, const LuPixelPoint &parentOrigin)

Protected Member Functions

virtual bool readAttributesFromMathMLDom (const QDomElement &element)
virtual void writeMathMLAttributes (QDomElement &element) const
void setAbsoluteSize (double s, bool fontsize=false)
void setRelativeSize (double s, bool fontsize=false)
void setPixelSize (double s, bool fontsize=false)
void setCharStyle (CharStyle cs)
CharStyle charStyle () const
void setCharFamily (CharFamily cf)
CharFamily charFamily () const
void setMathColor (const QColor &c)
QColor mathColor () const
void setMathBackground (const QColor &bg)
QColor mathBackground () const
void setFontWeight (bool w)
bool fontWeight () const
void setFontStyle (bool s)
bool fontStyle () const
void setFontFamily (const QString &s)
QString fontFamily () const
void setColor (const QColor &c)
QColor color () const
bool customMathVariant () const
bool customMathColor () const
bool customMathBackground () const
bool customFontWeight () const
bool customFontStyle () const
bool customFontFamily () const
bool customColor () const
virtual void setStyleSize (const ContextStyle &context, StyleAttributes &style)
virtual void setStyleVariant (StyleAttributes &style)
void setStyleColor (StyleAttributes &style)
virtual void setStyleBackground (StyleAttributes &style)
virtual void resetStyle (StyleAttributes &style)
QString getHtmlColor (const QString &colorStr)

Member Function Documentation

void TokenStyleElement::calcSizes ( const ContextStyle cstyle,
ContextStyle::TextStyle  tstyle,
ContextStyle::IndexStyle  istyle,
StyleAttributes &  style 
) [virtual]

Calculates our width and height and our children's parentPosition.

Reimplemented from SequenceElement.

Definition at line 44 of file tokenstyleelement.cc.

void TokenStyleElement::draw ( QPainter &  painter,
const LuPixelRect &  r,
const ContextStyle context,
ContextStyle::TextStyle  tstyle,
ContextStyle::IndexStyle  istyle,
StyleAttributes &  style,
const LuPixelPoint &  parentOrigin 
) [virtual]

Draws the whole element including its children.

The `parentOrigin' is the point this element's parent starts. We can use our parentPosition to get our own origin then.

Reimplemented from SequenceElement.

Definition at line 57 of file tokenstyleelement.cc.

bool TokenStyleElement::readAttributesFromMathMLDom ( const QDomElement &  element  )  [protected, virtual]

Reads our attributes from the MathML element.

Returns false if it failed.

Reimplemented from BasicElement.

Definition at line 79 of file tokenstyleelement.cc.

void TokenStyleElement::setStyleVariant ( StyleAttributes &  style  )  [protected, virtual]

Set the mathvariant related info in style stacks, including info for deprecated attributes.

It may be redefined by token elements whose behaviour differs from default one (e.g. identifiers)

Definition at line 450 of file tokenstyleelement.cc.

QString TokenStyleElement::getHtmlColor ( const QString &  colorStr  )  [protected]

Return RGB string from HTML Colors.

See HTML Spec, section 6.5

Definition at line 583 of file tokenstyleelement.cc.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys