IndexElement Class Reference
The element with up to four indexes in the four corners. More...
#include <indexelement.h>
Inheritance diagram for IndexElement:

Public Member Functions | |
IndexElement (BasicElement *parent=0) | |
IndexElement (const IndexElement &) | |
virtual IndexElement * | clone () |
virtual bool | accept (ElementVisitor *visitor) |
virtual QChar | getCharacter () 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) |
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) |
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 SequenceElement * | getMainChild () |
SequenceElement * | getExponent () |
virtual void | insert (FormulaCursor *, QPtrList< BasicElement > &, Direction) |
virtual void | remove (FormulaCursor *, QPtrList< BasicElement > &, Direction) |
virtual void | normalize (FormulaCursor *, Direction) |
virtual BasicElement * | getChild (FormulaCursor *, Direction=beforeCursor) |
virtual void | selectChild (FormulaCursor *cursor, BasicElement *child) |
virtual bool | isSenseless () |
bool | hasUpperLeft () const |
bool | hasUpperMiddle () const |
bool | hasUpperRight () const |
bool | hasLowerLeft () const |
bool | hasLowerMiddle () const |
bool | hasLowerRight () const |
void | setToUpperLeft (FormulaCursor *cursor) |
void | setToUpperMiddle (FormulaCursor *cursor) |
void | setToUpperRight (FormulaCursor *cursor) |
void | setToLowerLeft (FormulaCursor *cursor) |
void | setToLowerMiddle (FormulaCursor *cursor) |
void | setToLowerRight (FormulaCursor *cursor) |
void | moveToUpperLeft (FormulaCursor *cursor, Direction direction) |
void | moveToUpperMiddle (FormulaCursor *cursor, Direction direction) |
void | moveToUpperRight (FormulaCursor *cursor, Direction direction) |
void | moveToLowerLeft (FormulaCursor *cursor, Direction direction) |
void | moveToLowerMiddle (FormulaCursor *cursor, Direction direction) |
void | moveToLowerRight (FormulaCursor *cursor, Direction direction) |
ElementIndexPtr | getUpperLeft () |
ElementIndexPtr | getLowerLeft () |
ElementIndexPtr | getUpperMiddle () |
ElementIndexPtr | getLowerMiddle () |
ElementIndexPtr | getUpperRight () |
ElementIndexPtr | getLowerRight () |
ElementIndexPtr | getIndex (int position) |
virtual QString | toLatex () |
virtual QString | formulaString () |
virtual void | writeMathML (QDomDocument doc, QDomNode parent) |
Protected Member Functions | |
virtual QString | getTagName () const |
virtual void | writeDom (QDomElement element) |
virtual bool | readAttributesFromDom (QDomElement element) |
virtual bool | readContentFromDom (QDomNode &node) |
Detailed Description
The element with up to four indexes in the four corners.
Definition at line 34 of file indexelement.h.
Member Function Documentation
|
Visit this element. An implementation of the visitor pattern. Implements BasicElement. Definition at line 169 of file indexelement.cc. References ElementVisitor::visit(). |
|
Reimplemented from BasicElement. Definition at line 175 of file indexelement.cc. References SequenceElement::isTextOnly(). |
|
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 203 of file indexelement.cc. References BasicElement::formula(), and FormulaElement::tell(). |
|
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 217 of file indexelement.cc. References BasicElement::getHeight(), BasicElement::getWidth(), BasicElement::getX(), BasicElement::getY(), SequenceElement::goToPos(), BasicElement::goToPos(), and SequenceElement::moveLeft(). |
|
Calculates our width and height and our children's parentPosition.
Implements BasicElement. Definition at line 334 of file indexelement.cc. References BasicElement::axis(), SequenceElement::calcSizes(), BasicElement::getBaseline(), BasicElement::getHeight(), BasicElement::getWidth(), BasicElement::getY(), SequenceElement::isTextOnly(), BasicElement::setX(), and BasicElement::setY(). |
|
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 503 of file indexelement.cc. References SequenceElement::draw(). |
|
Dispatch this FontCommand to all our TextElement children.
Reimplemented from BasicElement. Definition at line 546 of file indexelement.cc. References SequenceElement::dispatchFontCommand(). |
|
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 609 of file indexelement.cc. References FormulaCursor::getLinearMovement(), FormulaCursor::isSelectionMode(), SequenceElement::moveLeft(), and BasicElement::moveLeft(). |
|
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 680 of file indexelement.cc. References FormulaCursor::getLinearMovement(), FormulaCursor::isSelectionMode(), SequenceElement::moveRight(), and BasicElement::moveRight(). |
|
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 751 of file indexelement.cc. References FormulaCursor::getElement(), FormulaCursor::getPos(), FormulaCursor::isSelectionMode(), SequenceElement::moveLeft(), SequenceElement::moveRight(), and BasicElement::moveUp(). |
|
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 798 of file indexelement.cc. References FormulaCursor::getElement(), FormulaCursor::getPos(), FormulaCursor::isSelectionMode(), BasicElement::moveDown(), SequenceElement::moveLeft(), and SequenceElement::moveRight(). |
|
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 152 of file indexelement.h. Referenced by SequenceElement::buildCommand(). |
|
Inserts all new children at the cursor position. Places the cursor according to the direction. You only can insert one index at a time. So the list must contain exactly on SequenceElement. And the index you want to insert must not exist already. The list will be emptied but stays the property of the caller. Reimplemented from BasicElement. Definition at line 867 of file indexelement.cc. References FormulaElement::changed(), BasicElement::formula(), FormulaCursor::getPos(), and FormulaCursor::setSelection(). |
|
Removes all selected children and returns them. Places the cursor to where the children have been. The cursor has to be inside one of our indexes which is supposed to be empty. The index will be removed and the cursor will be placed to the removed index so it can be inserted again. This methode is called by SequenceElement::remove only. The ownership of the list is passed to the caller. Reimplemented from BasicElement. Definition at line 920 of file indexelement.cc. References FormulaElement::changed(), FormulaElement::elementRemoval(), BasicElement::formula(), FormulaCursor::getPos(), BasicElement::remove(), and BasicElement::selectChild(). |
|
Moves the cursor to a normal place where new elements might be inserted.
Reimplemented from BasicElement. Definition at line 976 of file indexelement.cc. References SequenceElement::moveLeft(), and SequenceElement::moveRight(). |
|
Returns the child at the cursor.
Reimplemented from BasicElement. Definition at line 1001 of file indexelement.cc. References FormulaCursor::getPos(). |
|
Sets the cursor to select the child. The mark is placed before, the position behind it. Reimplemented from BasicElement. Definition at line 1034 of file indexelement.cc. |
|
Returns wether the element has no more useful children (except its main child) and should therefore be replaced by its main child's content.
Reimplemented from BasicElement. Definition at line 991 of file indexelement.cc. |
|
Returns the index at the position. Defaults to upperRight. Definition at line 1301 of file indexelement.cc. Referenced by SequenceElement::buildCommand(). |
|
Reimplemented from BasicElement. Definition at line 1322 of file indexelement.cc. References SequenceElement::toLatex(). |
|
Same as above, just MathML.
Reimplemented from BasicElement. Definition at line 1372 of file indexelement.cc. References SequenceElement::writeMathML(). |
|
Returns the tag name of this element type.
Reimplemented from BasicElement. Definition at line 274 of file indexelement.h. |
|
Appends our attributes to the dom element.
Reimplemented from BasicElement. Definition at line 1183 of file indexelement.cc. References BasicElement::getElementDom(), and BasicElement::writeDom(). |
|
Reads our attributes from the element. Returns false if it failed. Reimplemented from BasicElement. Definition at line 1229 of file indexelement.cc. References BasicElement::readAttributesFromDom(). |
|
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 1242 of file indexelement.cc. References BasicElement::buildChild(), and BasicElement::readContentFromDom(). |
The documentation for this class was generated from the following files: