lib
BracketElement Class Reference
#include <bracketelement.h>
Inheritance diagram for BracketElement:

Detailed Description
A left and/or right bracket around one child.
Definition at line 161 of file bracketelement.h.
Public Types | |
enum | { contentPos } |
Public Member Functions | |
BracketElement (SymbolType left=EmptyBracket, SymbolType right=EmptyBracket, BasicElement *parent=0) | |
~BracketElement () | |
BracketElement (const BracketElement &) | |
virtual BracketElement * | clone () |
virtual bool | accept (ElementVisitor *visitor) |
virtual TokenType | getTokenType () const |
virtual void | entered (SequenceElement *child) |
virtual BasicElement * | goToPos (FormulaCursor *, bool &handled, const LuPixelPoint &point, const LuPixelPoint &parentOrigin) |
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 QString | getTagName () const |
virtual bool | readAttributesFromDom (QDomElement element) |
virtual void | writeDom (QDomElement element) |
virtual QString | getElementName () const |
virtual void | writeMathMLAttributes (QDomElement &element) const |
virtual bool | readAttributesFromMathMLDom (const QDomElement &element) |
virtual int | readContentFromMathMLDom (QDomNode &node) |
virtual QString | toLatex () |
virtual QString | formulaString () |
Member Function Documentation
bool BracketElement::accept | ( | ElementVisitor * | visitor | ) | [virtual] |
Visit this element.
An implementation of the visitor pattern.
Implements BasicElement.
Definition at line 241 of file bracketelement.cc.
virtual TokenType BracketElement::getTokenType | ( | ) | const [inline, virtual] |
- Returns:
- the type of this element.
Used for parsing a sequence.
Reimplemented from BasicElement.
Definition at line 184 of file bracketelement.h.
void BracketElement::entered | ( | SequenceElement * | child | ) | [virtual] |
The cursor has entered one of our child sequences.
This is a good point to tell the user where he is.
Reimplemented from BasicElement.
Definition at line 247 of file bracketelement.cc.
BasicElement * BracketElement::goToPos | ( | FormulaCursor * | , | |
bool & | handled, | |||
const LuPixelPoint & | point, | |||
const LuPixelPoint & | parentOrigin | |||
) | [virtual] |
Sets the cursor and returns the element the point is in.
The handled flag shows whether the cursor has been set. This is needed because only the innermost matching element is allowed to set the cursor.
Reimplemented from SingleContentElement.
Definition at line 253 of file bracketelement.cc.
void BracketElement::calcSizes | ( | const ContextStyle & | context, | |
ContextStyle::TextStyle | tstyle, | |||
ContextStyle::IndexStyle | istyle, | |||
StyleAttributes & | style | |||
) | [virtual] |
Calculates our width and height and our children's parentPosition.
Implements BasicElement.
Definition at line 285 of file bracketelement.cc.
void BracketElement::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.
Definition at line 366 of file bracketelement.cc.
virtual QString BracketElement::getTagName | ( | ) | const [inline, protected, virtual] |
Returns the tag name of this element type.
Reimplemented from BasicElement.
Definition at line 229 of file bracketelement.h.
bool BracketElement::readAttributesFromDom | ( | QDomElement | element | ) | [protected, virtual] |
Reads our attributes from the element.
Returns false if it failed.
Reimplemented from BasicElement.
Definition at line 422 of file bracketelement.cc.
void BracketElement::writeDom | ( | QDomElement | element | ) | [protected, virtual] |
Appends our attributes to the dom element.
Reimplemented from SingleContentElement.
Definition at line 411 of file bracketelement.cc.
bool BracketElement::readAttributesFromMathMLDom | ( | const QDomElement & | element | ) | [protected, virtual] |
Reads our attributes from the MathML element.
Returns false if it failed.
Reimplemented from BasicElement.
Definition at line 442 of file bracketelement.cc.
int BracketElement::readContentFromMathMLDom | ( | QDomNode & | node | ) | [protected, virtual] |
Reads our content from the MathML node.
Sets the node to the next node that needs to be read. It is sometimes needed to read more than one node (e. g. for fence operators). Returns the number of nodes processed or -1 if it failed.
Reimplemented from SingleContentElement.
Definition at line 517 of file bracketelement.cc.
QString BracketElement::toLatex | ( | ) | [protected, virtual] |
- Returns:
- the latex representation of the element and of the element's children
Reimplemented from BasicElement.
Definition at line 604 of file bracketelement.cc.
The documentation for this class was generated from the following files: