lib
FormulaElement Class Reference
#include <formulaelement.h>
Inheritance diagram for FormulaElement:

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.
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, StyleAttributes &style) |
virtual void | draw (QPainter &painter, const LuPixelRect &r, const ContextStyle &context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes &style, 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, bool oasisFormat=false) const |
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) |
Constructor & Destructor Documentation
KFORMULA_NAMESPACE_BEGIN FormulaElement::FormulaElement | ( | FormulaDocument * | container | ) |
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.
Member Function Documentation
BasicElement * FormulaElement::goToPos | ( | FormulaCursor * | , | |
const LuPixelPoint & | point | |||
) |
virtual bool FormulaElement::readOnly | ( | const BasicElement * | ) | const [inline, virtual] |
Ordinary formulas are not write protected.
Reimplemented from BasicElement.
Definition at line 60 of file formulaelement.h.
virtual bool FormulaElement::readOnly | ( | const FormulaCursor * | ) | const [inline, virtual] |
- Returns:
- whether its prohibited to change the sequence with this cursor.
Reimplemented from SequenceElement.
Definition at line 65 of file formulaelement.h.
virtual FormulaElement* FormulaElement::formula | ( | ) | [inline, virtual] |
Provide fast access to the rootElement for each child.
Reimplemented from BasicElement.
Definition at line 70 of file formulaelement.h.
virtual const FormulaElement* FormulaElement::formula | ( | ) | const [inline, virtual] |
Provide fast access to the rootElement for each child.
Reimplemented from BasicElement.
Definition at line 75 of file formulaelement.h.
void FormulaElement::elementRemoval | ( | BasicElement * | child | ) |
Gets called just before the child is removed from the element tree.
Definition at line 69 of file formulaelement.cc.
void FormulaElement::changed | ( | ) | [virtual] |
Gets called whenever something changes and we need to recalc.
Definition at line 74 of file formulaelement.cc.
void FormulaElement::cursorHasMoved | ( | FormulaCursor * | ) |
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.
void FormulaElement::tell | ( | const QString & | msg | ) |
void FormulaElement::removeFormula | ( | FormulaCursor * | ) |
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.
void FormulaElement::calcSizes | ( | const ContextStyle & | context, | |
ContextStyle::TextStyle | tstyle, | |||
ContextStyle::IndexStyle | istyle, | |||
StyleAttributes & | style | |||
) | [virtual] |
Calculates our width and height and our children's parentPosition.
Reimplemented from SequenceElement.
Definition at line 119 of file formulaelement.cc.
void FormulaElement::draw | ( | QPainter & | painter, | |
const LuPixelRect & | r, | |||
const ContextStyle & | context, | |||
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.
Reimplemented from SequenceElement.
Definition at line 128 of file formulaelement.cc.
void FormulaElement::calcSizes | ( | ContextStyle & | context | ) |
void FormulaElement::draw | ( | QPainter & | painter, | |
const LuPixelRect & | r, | |||
ContextStyle & | context | |||
) |
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.
- Returns:
- the command that performs the requested action with the containers active cursor.
Reimplemented from SequenceElement.
Definition at line 173 of file formulaelement.cc.
const SymbolTable & FormulaElement::getSymbolTable | ( | ) | const |
QString FormulaElement::toLatex | ( | ) | [virtual] |
- Returns:
- the latex representation of the element and of the element's children
Reimplemented from SequenceElement.
Definition at line 311 of file formulaelement.cc.
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 202 of file formulaelement.cc.
void FormulaElement::writeMathML | ( | QDomDocument & | doc, | |
QDomNode & | parent, | |||
bool | oasisFormat = false | |||
) | const [virtual] |
Same as above, just MathML.
It shouldn't be redefined but for exceptional cases, use the general writeMathML* API instead
Reimplemented from BasicElement.
Definition at line 316 of file formulaelement.cc.
void FormulaElement::writeDom | ( | QDomElement | element | ) | [virtual] |
Appends our attributes to the dom element.
Reimplemented from SequenceElement.
Definition at line 225 of file formulaelement.cc.
QDomElement FormulaElement::emptyFormulaElement | ( | QDomDocument & | doc | ) |
For copy&paste we need to create an empty XML element.
Definition at line 190 of file formulaelement.cc.
virtual QString FormulaElement::getTagName | ( | ) | const [inline, protected, virtual] |
Returns the tag name of this element type.
Reimplemented from SequenceElement.
Definition at line 192 of file formulaelement.h.
bool FormulaElement::readAttributesFromDom | ( | QDomElement | element | ) | [protected, virtual] |
Reads our attributes from the element.
Returns false if it failed.
Reimplemented from SequenceElement.
Definition at line 238 of file formulaelement.cc.
bool FormulaElement::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 SequenceElement.
Definition at line 271 of file formulaelement.cc.
The documentation for this class was generated from the following files: