lib
RootElement Class Reference
#include <rootelement.h>
Inheritance diagram for RootElement:

Detailed Description
A nice graphical root.
Definition at line 35 of file rootelement.h.
Public Member Functions | |
RootElement (BasicElement *parent=0) | |
~RootElement () | |
RootElement (const RootElement &) | |
virtual RootElement * | clone () |
virtual bool | accept (ElementVisitor *visitor) |
virtual void | entered (SequenceElement *child) |
virtual BasicElement * | goToPos (FormulaCursor *, bool &handled, const LuPixelPoint &point, const LuPixelPoint &parentOrigin) |
virtual void | calcSizes (const ContextStyle &cstyle, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes &style) |
virtual void | draw (QPainter &painter, const LuPixelRect &r, const ContextStyle &cstyle, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes &style, const LuPixelPoint &parentOrigin) |
virtual void | dispatchFontCommand (FontCommand *cmd) |
virtual void | moveLeft (FormulaCursor *cursor, BasicElement *from) |
virtual void | moveRight (FormulaCursor *cursor, BasicElement *from) |
virtual void | moveUp (FormulaCursor *cursor, BasicElement *from) |
virtual void | moveDown (FormulaCursor *cursor, BasicElement *from) |
virtual void | insert (FormulaCursor *, QPtrList< BasicElement > &, Direction) |
virtual void | remove (FormulaCursor *, QPtrList< BasicElement > &, Direction) |
virtual void | normalize (FormulaCursor *, Direction) |
virtual SequenceElement * | getMainChild () |
SequenceElement * | getRadiant () |
virtual void | selectChild (FormulaCursor *cursor, BasicElement *child) |
void | moveToIndex (FormulaCursor *, Direction) |
void | setToIndex (FormulaCursor *) |
bool | hasIndex () const |
ElementIndexPtr | getIndex () |
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) |
virtual bool | readAttributesFromMathMLDom (const QDomElement &element) |
virtual int | readContentFromMathMLDom (QDomNode &node) |
Member Function Documentation
bool RootElement::accept | ( | ElementVisitor * | visitor | ) | [virtual] |
Visit this element.
An implementation of the visitor pattern.
Implements BasicElement.
Definition at line 123 of file rootelement.cc.
void RootElement::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 129 of file rootelement.cc.
BasicElement * RootElement::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 BasicElement.
Definition at line 140 of file rootelement.cc.
void RootElement::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.
Definition at line 181 of file rootelement.cc.
void RootElement::draw | ( | QPainter & | painter, | |
const LuPixelRect & | r, | |||
const ContextStyle & | cstyle, | |||
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 241 of file rootelement.cc.
void RootElement::dispatchFontCommand | ( | FontCommand * | cmd | ) | [virtual] |
Dispatch this FontCommand to all our TextElement children.
Reimplemented from BasicElement.
Definition at line 292 of file rootelement.cc.
void RootElement::moveLeft | ( | FormulaCursor * | cursor, | |
BasicElement * | from | |||
) | [virtual] |
Enters this element while moving to the left starting inside the element `from'.
Searches for a cursor position inside this element or to the left of it.
Reimplemented from BasicElement.
Definition at line 305 of file rootelement.cc.
void RootElement::moveRight | ( | FormulaCursor * | cursor, | |
BasicElement * | from | |||
) | [virtual] |
Enters this element while moving to the right starting inside the element `from'.
Searches for a cursor position inside this element or to the right of it.
Reimplemented from BasicElement.
Definition at line 334 of file rootelement.cc.
void RootElement::moveUp | ( | FormulaCursor * | cursor, | |
BasicElement * | from | |||
) | [virtual] |
Enters this element while moving up starting inside the element `from'.
Searches for a cursor position inside this element or above it.
Reimplemented from BasicElement.
Definition at line 363 of file rootelement.cc.
void RootElement::moveDown | ( | FormulaCursor * | cursor, | |
BasicElement * | from | |||
) | [virtual] |
Enters this element while moving down starting inside the element `from'.
Searches for a cursor position inside this element or below it.
Reimplemented from BasicElement.
Definition at line 391 of file rootelement.cc.
void RootElement::insert | ( | FormulaCursor * | , | |
QPtrList< BasicElement > & | , | |||
Direction | ||||
) | [virtual] |
Reinserts the index if it has been removed.
Reimplemented from BasicElement.
Definition at line 417 of file rootelement.cc.
void RootElement::remove | ( | FormulaCursor * | , | |
QPtrList< BasicElement > & | , | |||
Direction | ||||
) | [virtual] |
Removes all selected children and returns them.
Places the cursor to where the children have been.
We remove ourselve if we are requested to remove our content.
Reimplemented from BasicElement.
Definition at line 442 of file rootelement.cc.
void RootElement::normalize | ( | FormulaCursor * | , | |
Direction | ||||
) | [virtual] |
Moves the cursor to a normal place where new elements might be inserted.
Reimplemented from BasicElement.
Definition at line 466 of file rootelement.cc.
SequenceElement * RootElement::getMainChild | ( | ) | [virtual] |
Removes the child.
If this was the main child this element might request its own removal. The cursor is the one that caused the removal. It has to be moved to the place any user expects the cursor after that particular element has been removed.
Reimplemented from BasicElement.
Definition at line 481 of file rootelement.cc.
void RootElement::selectChild | ( | FormulaCursor * | cursor, | |
BasicElement * | child | |||
) | [virtual] |
Sets the cursor to select the child.
The mark is placed before, the position behind it.
Reimplemented from BasicElement.
Definition at line 499 of file rootelement.cc.
void RootElement::moveToIndex | ( | FormulaCursor * | , | |
Direction | ||||
) |
Moves the cursor away from the given child.
The cursor is guaranteed to be inside this element.
Definition at line 510 of file rootelement.cc.
QString RootElement::toLatex | ( | ) | [virtual] |
- Returns:
- the latex representation of the element and of the element's children
Reimplemented from BasicElement.
Definition at line 647 of file rootelement.cc.
virtual QString RootElement::getTagName | ( | ) | const [inline, protected, virtual] |
Returns the tag name of this element type.
Reimplemented from BasicElement.
Definition at line 191 of file rootelement.h.
void RootElement::writeDom | ( | QDomElement | element | ) | [protected, virtual] |
Appends our attributes to the dom element.
Reimplemented from BasicElement.
Definition at line 531 of file rootelement.cc.
bool RootElement::readAttributesFromDom | ( | QDomElement | element | ) | [protected, virtual] |
Reads our attributes from the element.
Returns false if it failed.
Reimplemented from BasicElement.
Definition at line 552 of file rootelement.cc.
bool RootElement::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 562 of file rootelement.cc.
bool RootElement::readAttributesFromMathMLDom | ( | const QDomElement & | element | ) | [protected, virtual] |
Reads our attributes from the MathML element.
Also checks whether it's a msqrt or mroot. Returns false if it failed.
Reimplemented from BasicElement.
Definition at line 595 of file rootelement.cc.
int RootElement::readContentFromMathMLDom | ( | QDomNode & | node | ) | [protected, virtual] |
Reads our content from the MathML node.
Sets the node to the next node that needs to be read. Returns false if it failed.
Reimplemented from BasicElement.
Definition at line 610 of file rootelement.cc.
The documentation for this class was generated from the following files: