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 &context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle) |
virtual void | draw (QPainter &painter, const LuPixelRect &r, const ContextStyle &context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, const LuPixelPoint &parentOrigin) |
virtual void | dispatchFontCommand (FontCommand *cmd) |
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 () |
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) |
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.
void TextElement::calcSizes | ( | const ContextStyle & | context, | |
ContextStyle::TextStyle | tstyle, | |||
ContextStyle::IndexStyle | istyle | |||
) | [virtual] |
Calculates our width and height and our children's parentPosition.
Implements BasicElement.
Definition at line 111 of file textelement.cc.
void TextElement::dispatchFontCommand | ( | FontCommand * | cmd | ) | [virtual] |
Dispatch this FontCommand to all our TextElement children.
Reimplemented from BasicElement.
Definition at line 225 of file textelement.cc.
void TextElement::draw | ( | QPainter & | painter, | |
const LuPixelRect & | r, | |||
const ContextStyle & | context, | |||
ContextStyle::TextStyle | tstyle, | |||
ContextStyle::IndexStyle | istyle, | |||
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.
Definition at line 149 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.
QFont TextElement::getFont | ( | const ContextStyle & | context | ) | [protected] |
QChar TextElement::getRealCharacter | ( | const ContextStyle & | context | ) | [protected] |
- Returns:
- the char that is used to draw with the given font.
Definition at line 242 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 130 of file textelement.h.
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.
bool TextElement::isSymbol | ( | ) | const [inline] |
bool TextElement::readAttributesFromDom | ( | QDomElement | element | ) | [protected, virtual] |
Reads our attributes from the element.
Returns false if it failed.
Reimplemented from BasicElement.
Definition at line 357 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 438 of file textelement.cc.
void TextElement::setUpPainter | ( | const ContextStyle & | context, | |
QPainter & | painter | |||
) | [protected] |
QString TextElement::toLatex | ( | ) | [virtual] |
- Returns:
- the latex representation of the element and of the element's children
Reimplemented from BasicElement.
Definition at line 443 of file textelement.cc.
void TextElement::writeDom | ( | QDomElement | element | ) | [protected, virtual] |
Appends our attributes to the dom element.
Reimplemented from BasicElement.
Definition at line 328 of file textelement.cc.
The documentation for this class was generated from the following files: