FractionElement Class Reference
A fraction. More...
#include <fractionelement.h>
Inheritance diagram for FractionElement:


Public Types | |
enum | { numeratorPos, denominatorPos } |
Public Member Functions | |
FractionElement (BasicElement *parent=0) | |
FractionElement (const FractionElement &) | |
virtual FractionElement * | 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 &style, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle) |
virtual void | draw (QPainter &painter, const LuPixelRect &r, const ContextStyle &style, 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 void | insert (FormulaCursor *, QPtrList< BasicElement > &, Direction) |
virtual void | remove (FormulaCursor *, QPtrList< BasicElement > &, Direction) |
virtual SequenceElement * | getMainChild () |
SequenceElement * | getNumerator () |
SequenceElement * | getDenominator () |
virtual bool | isSenseless () |
virtual void | selectChild (FormulaCursor *cursor, BasicElement *child) |
void | showLine (bool line) |
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 fraction.
Definition at line 33 of file fractionelement.h.
Member Function Documentation
|
Visit this element. An implementation of the visitor pattern. Implements BasicElement. Definition at line 58 of file fractionelement.cc. References ElementVisitor::visit(). |
|
Reimplemented from BasicElement. Definition at line 54 of file fractionelement.h. |
|
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 63 of file fractionelement.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 74 of file fractionelement.cc. References BasicElement::getHeight(), 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 117 of file fractionelement.cc. References SequenceElement::calcSizes(), BasicElement::getHeight(), BasicElement::getWidth(), 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 147 of file fractionelement.cc. References SequenceElement::draw(). |
|
Dispatch this FontCommand to all our TextElement children.
Reimplemented from BasicElement. Definition at line 177 of file fractionelement.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 188 of file fractionelement.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 218 of file fractionelement.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 248 of file fractionelement.cc. References FormulaCursor::isSelectionMode(), 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 272 of file fractionelement.cc. References FormulaCursor::isSelectionMode(), BasicElement::moveDown(), and SequenceElement::moveRight(). |
|
Reinserts the denominator if it has been removed.
Reimplemented from BasicElement. Definition at line 294 of file fractionelement.cc. References FormulaElement::changed(), BasicElement::formula(), FormulaCursor::getPos(), SequenceElement::moveLeft(), SequenceElement::moveRight(), BasicElement::setParent(), and FormulaCursor::setSelection(). |
|
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 numerator. It is possible to remove the denominator. But after this we are senseless and the caller is required to replace us. Reimplemented from BasicElement. Definition at line 323 of file fractionelement.cc. References FormulaElement::changed(), FormulaElement::elementRemoval(), BasicElement::formula(), FormulaCursor::getPos(), BasicElement::remove(), BasicElement::selectChild(), and FormulaCursor::setTo(). |
|
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 358 of file fractionelement.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 348 of file fractionelement.cc. |
|
Sets the cursor to select the child. The mark is placed before, the position behind it. Reimplemented from BasicElement. Definition at line 376 of file fractionelement.cc. References FormulaCursor::setTo(). |
|
Tells whether the fraction should be drawn with a line.
Definition at line 169 of file fractionelement.h. Referenced by SequenceElement::buildCommand(), and NameSequence::replaceElement(). |
|
Reimplemented from BasicElement. Definition at line 448 of file fractionelement.cc. References SequenceElement::toLatex(). |
|
Same as above, just MathML.
Reimplemented from BasicElement. Definition at line 463 of file fractionelement.cc. References SequenceElement::writeMathML(). |
|
Returns the tag name of this element type.
Reimplemented from BasicElement. Definition at line 188 of file fractionelement.h. |
|
Appends our attributes to the dom element.
Reimplemented from BasicElement. Definition at line 390 of file fractionelement.cc. References BasicElement::getElementDom(), and BasicElement::writeDom(). |
|
Reads our attributes from the element. Returns false if it failed. Reimplemented from BasicElement. Definition at line 410 of file fractionelement.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 427 of file fractionelement.cc. References BasicElement::buildChild(), and BasicElement::readContentFromDom(). |
The documentation for this class was generated from the following files: