FormulaElement Class Reference
The main element. More...
#include <formulaelement.h>
Inheritance diagram for FormulaElement:

Public Member Functions | |
FormulaElement (FormulaDocument *container) | |
virtual FormulaElement * | clone () |
BasicElement * | goToPos (FormulaCursor *, const LuPixelPoint &point) |
virtual bool | readOnly (const BasicElement *) const |
virtual bool | readOnly (const FormulaCursor *) const |
virtual FormulaElement * | formula () |
virtual const FormulaElement * | formula () const |
void | elementRemoval (BasicElement *child) |
virtual void | changed () |
void | cursorHasMoved (FormulaCursor *) |
void | moveOutLeft (FormulaCursor *) |
void | moveOutRight (FormulaCursor *) |
void | moveOutBelow (FormulaCursor *) |
void | moveOutAbove (FormulaCursor *) |
void | tell (const QString &msg) |
void | removeFormula (FormulaCursor *) |
void | insertFormula (FormulaCursor *) |
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) |
void | calcSizes (ContextStyle &context) |
void | draw (QPainter &painter, const LuPixelRect &r, ContextStyle &context) |
virtual KCommand * | buildCommand (Container *, Request *) |
const SymbolTable & | getSymbolTable () const |
virtual QString | toLatex () |
int | getBaseSize () const |
void | setBaseSize (int size) |
bool | hasOwnBaseSize () const |
virtual KCommand * | input (Container *container, QKeyEvent *event) |
virtual void | writeMathML (QDomDocument doc, QDomNode parent) |
virtual void | writeDom (QDomElement element) |
QDomElement | emptyFormulaElement (QDomDocument doc) |
Protected Member Functions | |
virtual QString | getTagName () const |
virtual bool | readAttributesFromDom (QDomElement element) |
virtual bool | readContentFromDom (QDomNode &node) |
Detailed Description
The main element.A formula consists of a FormulaElement and its children. The only element that has no parent.
Definition at line 40 of file formulaelement.h.
Constructor & Destructor Documentation
|
The container this FormulaElement belongs to must not be 0, except you really know what you are doing.
Definition at line 34 of file formulaelement.cc. References FormulaElement(). Referenced by FormulaElement(). |
Member Function Documentation
|
Returns the element the point is in.
Definition at line 56 of file formulaelement.cc. References SequenceElement::countChildren(), goToPos(), and FormulaCursor::setTo(). Referenced by goToPos(). |
|
Ordinary formulas are not write protected.
Reimplemented from BasicElement. Definition at line 60 of file formulaelement.h. References readOnly(). Referenced by readOnly(). |
|
Reimplemented from SequenceElement. Definition at line 65 of file formulaelement.h. |
|
Provide fast access to the rootElement for each child.
Reimplemented from BasicElement. Definition at line 70 of file formulaelement.h. |
|
Provide fast access to the rootElement for each child.
Reimplemented from BasicElement. Definition at line 75 of file formulaelement.h. |
|
Gets called just before the child is removed from the element tree.
Definition at line 69 of file formulaelement.cc. References FormulaDocument::elementRemoval(), and elementRemoval(). Referenced by elementRemoval(), SymbolElement::remove(), SequenceElement::remove(), RootElement::remove(), MultilineElement::remove(), IndexElement::remove(), and FractionElement::remove(). |
|
Gets called whenever something changes and we need to recalc.
Definition at line 74 of file formulaelement.cc. References FormulaDocument::changed(). Referenced by SymbolElement::insert(), SequenceElement::insert(), RootElement::insert(), MultilineElement::insert(), IndexElement::insert(), FractionElement::insert(), SymbolElement::remove(), SequenceElement::remove(), RootElement::remove(), MultilineElement::remove(), IndexElement::remove(), and FractionElement::remove(). |
|
Gets called when a request has the side effect of moving the cursor. In the end any operation that moves the cursor should call this. Definition at line 79 of file formulaelement.cc. References FormulaDocument::cursorHasMoved(), and cursorHasMoved(). Referenced by SequenceElement::buildCommand(), cursorHasMoved(), and SequenceElement::input(). |
|
Tell the user something has happened.
Definition at line 104 of file formulaelement.cc. References FormulaDocument::tell(), and tell(). Referenced by SequenceElement::buildCommand(), RootElement::entered(), MultilineElement::entered(), MatrixElement::entered(), IndexElement::entered(), FractionElement::entered(), UnderlineElement::entered(), OverlineElement::entered(), BracketElement::entered(), BasicElement::entered(), SequenceElement::moveLeft(), SequenceElement::moveRight(), and tell(). |
|
Gets called when the formula wants to vanish. The one who holds it should create an appropriate command and execute it. Definition at line 109 of file formulaelement.cc. References FormulaDocument::removeFormula(), and removeFormula(). Referenced by removeFormula(). |
|
Calculates our width and height and our children's parentPosition.
Reimplemented from SequenceElement. Definition at line 119 of file formulaelement.cc. References calcSizes(). Referenced by calcSizes(), and Container::recalc(). |
|
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. Reimplemented from SequenceElement. Definition at line 127 of file formulaelement.cc. References draw(). Referenced by Container::draw(), draw(), and Container::print(). |
|
Calculates the formulas sizes and positions.
Definition at line 140 of file formulaelement.cc. References ContextStyle::baseSize(), calcSizes(), ContextStyle::getBaseTextStyle(), and ContextStyle::setSizeFactor(). |
|
Draws the whole thing.
Definition at line 156 of file formulaelement.cc. References ContextStyle::baseSize(), draw(), ContextStyle::getBaseTextStyle(), and ContextStyle::setSizeFactor(). |
|
This is called by the container to get a command depending on the current cursor position (this is how the element gets chosen) and the request.
Reimplemented from SequenceElement. Definition at line 170 of file formulaelement.cc. References buildCommand(). Referenced by buildCommand(). |
|
Definition at line 181 of file formulaelement.cc. References FormulaDocument::getSymbolTable(). Referenced by SequenceElement::parse(). |
|
Reimplemented from SequenceElement. Definition at line 308 of file formulaelement.cc. Referenced by Container::texString(). |
|
Parses the input. It's the container which does create new elements because it owns the undo stack. But only the sequence knows what chars are allowed. Reimplemented from SequenceElement. Definition at line 199 of file formulaelement.cc. References Container::activeCursor(), and input(). Referenced by input(). |
|
Same as above, just MathML.
Reimplemented from SequenceElement. Definition at line 313 of file formulaelement.cc. References writeMathML(). Referenced by Container::saveMathML(), and writeMathML(). |
|
Appends our attributes to the dom element.
Reimplemented from SequenceElement. Definition at line 222 of file formulaelement.cc. References writeDom(). Referenced by writeDom(). |
|
For copy&paste we need to create an empty XML element.
Definition at line 187 of file formulaelement.cc. References emptyFormulaElement(), and getTagName(). Referenced by FormulaCursor::copy(), and emptyFormulaElement(). |
|
Returns the tag name of this element type.
Reimplemented from SequenceElement. Definition at line 190 of file formulaelement.h. Referenced by emptyFormulaElement(). |
|
Reads our attributes from the element. Returns false if it failed. Reimplemented from SequenceElement. Definition at line 235 of file formulaelement.cc. References readAttributesFromDom(). Referenced by 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 SequenceElement. Definition at line 268 of file formulaelement.cc. References readContentFromDom(). Referenced by readContentFromDom(). |
The documentation for this class was generated from the following files: