SymbolElement Class Reference
A symbol is simply a piece of art. More...
#include <symbolelement.h>
Inheritance diagram for SymbolElement:

Public Member Functions | |
SymbolElement (SymbolType type=EmptyBracket, BasicElement *parent=0) | |
SymbolElement (const SymbolElement &) | |
virtual SymbolElement * | clone () |
virtual bool | accept (ElementVisitor *visitor) |
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 () |
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) |
bool | hasUpper () const |
bool | hasLower () const |
void | setToUpper (FormulaCursor *cursor) |
void | setToLower (FormulaCursor *cursor) |
void | moveToUpper (FormulaCursor *, Direction) |
void | moveToLower (FormulaCursor *, Direction) |
ElementIndexPtr | getUpperIndex () |
ElementIndexPtr | getLowerIndex () |
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
A symbol is simply a piece of art.
Definition at line 33 of file symbolelement.h.
Member Function Documentation
|
Visit this element. An implementation of the visitor pattern. Implements BasicElement. Definition at line 130 of file symbolelement.cc. References ElementVisitor::visit(). |
|
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 136 of file symbolelement.cc. References BasicElement::getX(), SequenceElement::goToPos(), BasicElement::goToPos(), hasUpper(), SequenceElement::moveLeft(), and SequenceElement::moveRight(). |
|
Calculates our width and height and our children's parentPosition.
Implements BasicElement. Definition at line 197 of file symbolelement.cc. References BasicElement::axis(), SequenceElement::calcSizes(), BasicElement::getBaseline(), BasicElement::getHeight(), BasicElement::getWidth(), BasicElement::getX(), BasicElement::getY(), hasUpper(), 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 302 of file symbolelement.cc. References SequenceElement::draw(), and hasUpper(). |
|
Dispatch this FontCommand to all our TextElement children.
Reimplemented from BasicElement. Definition at line 345 of file symbolelement.cc. References SequenceElement::dispatchFontCommand(), and hasUpper(). |
|
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 369 of file symbolelement.cc. References FormulaCursor::getLinearMovement(), hasUpper(), 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 409 of file symbolelement.cc. References FormulaCursor::getLinearMovement(), hasUpper(), 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 449 of file symbolelement.cc. References hasUpper(), 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 477 of file symbolelement.cc. References 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 140 of file symbolelement.h. |
|
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 525 of file symbolelement.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 565 of file symbolelement.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 597 of file symbolelement.cc. References SequenceElement::moveLeft(), and SequenceElement::moveRight(). |
|
Returns the child at the cursor.
Reimplemented from BasicElement. Definition at line 610 of file symbolelement.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 628 of file symbolelement.cc. |
|
Moves the cursor away from the given child. The cursor is guaranteed to be inside this element. Definition at line 192 of file symbolelement.h. Referenced by calcSizes(), dispatchFontCommand(), draw(), goToPos(), moveLeft(), moveRight(), moveUp(), toLatex(), writeDom(), and writeMathML(). |
|
Returns the index at the position. Defaults to upperRight. Definition at line 688 of file symbolelement.cc. |
|
Reimplemented from BasicElement. Definition at line 782 of file symbolelement.cc. References hasUpper(), and SequenceElement::toLatex(). |
|
Same as above, just MathML.
Reimplemented from BasicElement. Definition at line 850 of file symbolelement.cc. References hasUpper(), and SequenceElement::writeMathML(). |
|
Returns the tag name of this element type.
Reimplemented from BasicElement. Definition at line 235 of file symbolelement.h. |
|
Appends our attributes to the dom element.
Reimplemented from BasicElement. Definition at line 703 of file symbolelement.cc. References BasicElement::getElementDom(), hasUpper(), and BasicElement::writeDom(). |
|
Reads our attributes from the element. Returns false if it failed. Reimplemented from BasicElement. Definition at line 731 of file symbolelement.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 750 of file symbolelement.cc. References BasicElement::buildChild(), and BasicElement::readContentFromDom(). |
The documentation for this class was generated from the following files: