lib
TextElement Class Reference
#include <textelement.h>
Inheritance diagram for TextElement:

Detailed Description
An element that represents one char.
Definition at line 37 of file textelement.h.
Public Member Functions | |
TextElement (QChar ch= ' ', bool beSymbol=false, BasicElement *parent=0) | |
TextElement (const TextElement &) | |
virtual TextElement * | clone () |
virtual bool | accept (ElementVisitor *visitor) |
virtual TokenType | getTokenType () const |
virtual bool | isInvisible () const |
virtual QChar | getCharacter () const |
virtual void | calcSizes (const ContextStyle &cstyle, 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) |
virtual void | dispatchFontCommand (FontCommand *cmd) |
void | setColor (QColor c) |
CharStyle | getCharStyle () const |
void | setCharStyle (CharStyle cs) |
CharFamily | getCharFamily () const |
void | setCharFamily (CharFamily cf) |
char | format () const |
bool | isSymbol () const |
virtual QString | toLatex () |
virtual QString | formulaString () |
virtual void | writeMathML (QDomDocument &doc, QDomNode &parent, bool oasisFormat=false) const |
Protected Member Functions | |
virtual QString | getTagName () const |
virtual void | writeDom (QDomElement element) |
virtual bool | readAttributesFromDom (QDomElement element) |
virtual bool | readContentFromDom (QDomNode &node) |
QChar | getRealCharacter (const ContextStyle &context) |
QFont | getFont (const ContextStyle &context, const StyleAttributes &style) |
void | setUpPainter (const ContextStyle &context, QPainter &painter) |
const SymbolTable & | getSymbolTable () const |
Member Function Documentation
bool TextElement::accept | ( | ElementVisitor * | visitor | ) | [virtual] |
Visit this element.
An implementation of the visitor pattern.
Implements BasicElement.
Definition at line 57 of file textelement.cc.
TokenType TextElement::getTokenType | ( | ) | const [virtual] |
- Returns:
- the type of this element.
Used for parsing a sequence.
Reimplemented from BasicElement.
Definition at line 63 of file textelement.cc.
bool TextElement::isInvisible | ( | ) | const [virtual] |
- Returns:
- true if we don't want to see the element.
Reimplemented from BasicElement.
Definition at line 98 of file textelement.cc.
virtual QChar TextElement::getCharacter | ( | ) | const [inline, virtual] |
- Returns:
- the character that represents this element.
Used for parsing a sequence.
Reimplemented from BasicElement.
Definition at line 65 of file textelement.h.
void TextElement::calcSizes | ( | const ContextStyle & | cstyle, | |
ContextStyle::TextStyle | tstyle, | |||
ContextStyle::IndexStyle | istyle, | |||
StyleAttributes & | style | |||
) | [virtual] |
Calculates our width and height and our children's parentPosition.
Implements BasicElement.
Reimplemented in GlyphElement.
Definition at line 111 of file textelement.cc.
void TextElement::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.
Implements BasicElement.
Reimplemented in GlyphElement.
Definition at line 162 of file textelement.cc.
void TextElement::dispatchFontCommand | ( | FontCommand * | cmd | ) | [virtual] |
Dispatch this FontCommand to all our TextElement children.
Reimplemented from BasicElement.
Definition at line 258 of file textelement.cc.
void TextElement::setColor | ( | QColor | c | ) | [inline] |
bool TextElement::isSymbol | ( | ) | const [inline] |
QString TextElement::toLatex | ( | ) | [virtual] |
- Returns:
- the latex representation of the element and of the element's children
Reimplemented from BasicElement.
Definition at line 477 of file textelement.cc.
void TextElement::writeMathML | ( | QDomDocument & | doc, | |
QDomNode & | parent, | |||
bool | oasisFormat = false | |||
) | const [virtual] |
Same as above, just MathML.
It shouldn't be redefined but for exceptional cases, use the general writeMathML* API instead
Reimplemented from BasicElement.
Definition at line 354 of file textelement.cc.
virtual QString TextElement::getTagName | ( | ) | const [inline, protected, virtual] |
- Returns:
- the tag name of this element type.
Reimplemented from BasicElement.
Definition at line 141 of file textelement.h.
void TextElement::writeDom | ( | QDomElement | element | ) | [protected, virtual] |
Appends our attributes to the dom element.
Reimplemented from BasicElement.
Definition at line 362 of file textelement.cc.
bool TextElement::readAttributesFromDom | ( | QDomElement | element | ) | [protected, virtual] |
Reads our attributes from the element.
Returns false if it failed.
Reimplemented from BasicElement.
Definition at line 391 of file textelement.cc.
bool TextElement::readContentFromDom | ( | QDomNode & | node | ) | [protected, virtual] |
Reads our content from the node.
Sets the node to the next node that needs to be read. Returns false if it failed.
Reimplemented from BasicElement.
Definition at line 472 of file textelement.cc.
QChar TextElement::getRealCharacter | ( | const ContextStyle & | context | ) | [protected] |
- Returns:
- the char that is used to draw with the given font.
Definition at line 275 of file textelement.cc.
QFont TextElement::getFont | ( | const ContextStyle & | context, | |
const StyleAttributes & | style | |||
) | [protected] |
void TextElement::setUpPainter | ( | const ContextStyle & | context, | |
QPainter & | painter | |||
) | [protected] |
The documentation for this class was generated from the following files: