Container Class Reference
The document. More...
#include <kformulacontainer.h>
Inheritance diagram for Container:

Public Types | |
enum | ViewActions { EXIT_LEFT, EXIT_RIGHT, EXIT_ABOVE, EXIT_BELOW, INSERT_FORMULA, REMOVE_FORMULA } |
Signals | |
void | cursorMoved (FormulaCursor *cursor) |
void | leaveFormula (Container *formula, FormulaCursor *cursor, int cmd) |
void | formulaChanged (int width, int height) |
void | formulaChanged (double width, double height) |
void | statusMsg (const QString &msg) |
void | errorMsg (const QString &) |
void | elementWillVanish (BasicElement *element) |
void | formulaLoaded (FormulaElement *) |
void | baseSizeChanged (int) |
Public Member Functions | |
Container (Document *doc, int pos, bool registerMe=true) | |
void | initialize () |
FormulaCursor * | createCursor () |
void | elementRemoval (BasicElement *child) |
void | changed () |
void | cursorHasMoved (FormulaCursor *) |
void | moveOutLeft (FormulaCursor *) |
void | moveOutRight (FormulaCursor *) |
void | moveOutAbove (FormulaCursor *) |
void | moveOutBelow (FormulaCursor *) |
void | tell (const QString &msg) |
void | removeFormula (FormulaCursor *) |
void | registerFormula (int pos=-1) |
void | unregisterFormula () |
void | baseSizeChanged (int size, bool owned) |
void | draw (QPainter &painter, const QRect &r, const QColorGroup &cg, bool edit=false) |
void | draw (QPainter &painter, const QRect &r, bool edit=false) |
void | save (QDomElement root) |
void | saveMathML (QTextStream &stream) |
bool | loadMathML (QDomDocument doc) |
bool | load (QDomElement fe) |
QString | texString () |
QString | formulaString () |
void | print (KPrinter &printer) |
QImage | drawImage (int width, int height) |
FormulaCursor * | activeCursor () |
const FormulaCursor * | activeCursor () const |
void | setActiveCursor (FormulaCursor *cursor) |
QRect | boundingRect () const |
QRect | coveredRect () |
double | width () const |
double | height () const |
double | baseline () const |
void | moveTo (int x, int y) |
virtual double | getDocumentX () const |
virtual double | getDocumentY () const |
virtual void | setDocumentPosition (double, double) |
virtual void | startEvaluation () |
void | testDirty () |
virtual void | recalc () |
bool | isEmpty () |
virtual Document * | document () const |
virtual const SymbolTable & | getSymbolTable () const |
int | fontSize () const |
void | setFontSize (int pointSize, bool forPrint=false) |
void | setFontSizeDirect (int pointSize) |
void | input (QKeyEvent *event) |
void | performRequest (Request *request) |
void | paste () |
void | paste (QDomDocument document, QString desc) |
void | copy () |
void | cut () |
Protected Member Functions | |
KoCommandHistory * | getHistory () const |
FormulaElement * | rootElement () const |
virtual FormulaElement * | createMainSequence () |
void | emitErrorMsg (const QString &) |
Friends | |
class | MimeSource |
class | TestFormulaCursor |
class | TestFormulaElement |
class | TestIndexElement |
class | TestCommands |
Detailed Description
The document.Actually only one part of the whole. Provides everything to edit the formula.
Definition at line 90 of file kformulacontainer.h.
Constructor & Destructor Documentation
|
Constructs a new formula and register it with the document.
Definition at line 109 of file kformulacontainer.cc. References registerFormula(). |
Member Function Documentation
|
Needs to be called before anything else can be done with a newly created formula! This is required to allow polymorphic formulas. (The virtual method problem.) Definition at line 126 of file kformulacontainer.cc. References createCursor(), createMainSequence(), and recalc(). Referenced by Document::createFormula(). |
|
Returns a new cursor. It points to the beginning of the formula. The cursor gets no messages if the formula changes so use this with care! Definition at line 141 of file kformulacontainer.cc. References rootElement(). Referenced by initialize(). |
|
Gets called just before the child is removed from the element tree.
Reimplemented from FormulaDocument. Definition at line 157 of file kformulacontainer.cc. References elementWillVanish(). |
|
Gets called when ever something changes and we need to recalc.
Reimplemented from FormulaDocument. Definition at line 166 of file kformulacontainer.cc. |
|
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. Reimplemented from FormulaDocument. Definition at line 171 of file kformulacontainer.cc. |
|
Inside the formula occurred an event that must be handled outside.
Reimplemented from FormulaDocument. Definition at line 176 of file kformulacontainer.cc. References leaveFormula(). |
|
Register and unregister this formula with its document.
Definition at line 207 of file kformulacontainer.cc. References document(), and Document::registerFormula(). Referenced by Container(). |
|
The base size changed. If not owned it uses the default one now. Reimplemented from FormulaDocument. Definition at line 218 of file kformulacontainer.cc. References ContextStyle::baseSize(), document(), and Document::getContextStyle(). |
|
Draws the whole thing.
Definition at line 294 of file kformulacontainer.cc. |
|
Draws the whole thing.
Definition at line 301 of file kformulacontainer.cc. References document(), FormulaElement::draw(), Document::getContextStyle(), KoZoomHandler::pixelToLayoutUnit(), and rootElement(). |
|
Saves the data into the document.
Definition at line 484 of file kformulacontainer.cc. References rootElement(). |
|
Save formula as MathML.
Definition at line 518 of file kformulacontainer.cc. References rootElement(), and FormulaElement::writeMathML(). |
|
Load function. Load the formula from the specified file containing MathML . Definition at line 528 of file kformulacontainer.cc. References KoCommandHistory::clear(), document(), Document::getContextStyle(), MathML2KFormula::getKFormulaDom(), load(), and MathML2KFormula::startConversion(). |
|
Loads a formula from the document.
Definition at line 494 of file kformulacontainer.cc. References BasicElement::buildFromDom(), createMainSequence(), formulaLoaded(), recalc(), and rootElement(). Referenced by loadMathML(), and Document::loadXML(). |
|
a tex string for the formula
Definition at line 587 of file kformulacontainer.cc. References rootElement(), and FormulaElement::toLatex(). |
|
Prints the formula.
Definition at line 542 of file kformulacontainer.cc. References document(), FormulaElement::draw(), and rootElement(). |
|
Definition at line 555 of file kformulacontainer.cc. References document(), Document::getContextStyle(), KoZoomHandler::layoutUnitToPixelX(), KoZoomHandler::layoutUnitToPixelY(), ContextStyle::setZoomAndResolution(), and KoZoomHandler::zoom(). |
|
Definition at line 229 of file kformulacontainer.cc. Referenced by SequenceElement::buildCommand(), copy(), cut(), SequenceElement::input(), input(), FormulaElement::input(), paste(), and recalc(). |
|
Sets the cursor that is to be used for any editing. The active cursor might 0. In this case you must not request any change from the formula. Definition at line 244 of file kformulacontainer.cc. References Document::activate(), and document(). |
|
Definition at line 407 of file kformulacontainer.cc. References document(), Document::getContextStyle(), KoZoomHandler::layoutUnitToPixelX(), KoZoomHandler::layoutUnitToPixelY(), and rootElement(). Referenced by coveredRect(). |
|
Definition at line 416 of file kformulacontainer.cc. References boundingRect(), document(), Document::getContextStyle(), KoZoomHandler::layoutUnitToPixelX(), KoZoomHandler::layoutUnitToPixelY(), and rootElement(). |
|
Definition at line 445 of file kformulacontainer.cc. References document(), Document::getContextStyle(), KoTextZoomHandler::layoutUnitPtToPt(), KoZoomHandler::pixelYToPt(), and rootElement(). |
|
Moves the formula to a new location. This location will be the upper left corner of the rectangle that is drawn by the painter. Definition at line 452 of file kformulacontainer.cc. References document(), Document::getContextStyle(), KoZoomHandler::pixelToLayoutUnitX(), KoZoomHandler::pixelToLayoutUnitY(), rootElement(), BasicElement::setX(), and BasicElement::setY(). |
|
KWord uses a transformed painter to draw formulas, so every formula has the internal position (0,0). But we might need to sort our formulas according to their position inside the document. (This is only needed for math formulas.) Definition at line 264 of file kformulacontainer.h. |
|
Start the documents evaluation at this formula. This must be the formula that changed. The formulas above it won't be affected by this change. This has no meaning in not evaluating formulas. Definition at line 275 of file kformulacontainer.h. |
|
Recalcs the formula and emits the .*Changed signals if needed.
Definition at line 262 of file kformulacontainer.cc. References recalc(). |
|
Recalc the formula.
Definition at line 269 of file kformulacontainer.cc. References activeCursor(), FormulaElement::calcSizes(), cursorMoved(), formulaChanged(), KoTextZoomHandler::layoutUnitPtToPt(), KoZoomHandler::layoutUnitToPixelX(), KoZoomHandler::layoutUnitToPixelY(), KoZoomHandler::pixelXToPt(), KoZoomHandler::pixelYToPt(), and rootElement(). Referenced by initialize(), load(), and testDirty(). |
|
Definition at line 282 of file kformulacontainer.cc. References SequenceElement::countChildren(), and rootElement(). |
|
Definition at line 107 of file kformulacontainer.cc. Referenced by baseline(), baseSizeChanged(), boundingRect(), SequenceElement::buildCommand(), copy(), coveredRect(), draw(), drawImage(), SequenceElement::input(), loadMathML(), moveTo(), print(), registerFormula(), and setActiveCursor(). |
|
Sets the base font size of this formula.
Definition at line 470 of file kformulacontainer.cc. References FormulaElement::getBaseSize(), and rootElement(). |
|
The cursor has been moved but the formula hasn't been changed. The view that owns the cursor needs to know this. Referenced by recalc(). |
|
The cursor wants to leave this formula.
Referenced by moveOutLeft(). |
|
The formula has changed and needs to be redrawn.
Referenced by recalc(). |
|
A message that might be a useful hint. Meant for the statusbar. |
|
A message that describes an error. Meant for a message box. (?) |
|
The element is going to leave the formula with and all its children.
Referenced by elementRemoval(). |
|
Tells the cursors that we have just loaded a new formula.
Referenced by load(). |
|
We've got a new base size.
|
|
General input.
Definition at line 317 of file kformulacontainer.cc. References activeCursor(). |
|
Insert data from the clipboard.
Definition at line 337 of file kformulacontainer.cc. |
|
Insert data from the document.
Definition at line 351 of file kformulacontainer.cc. References activeCursor(), KFCAdd::addElement(), and FormulaCursor::buildElementsFromDom(). |
|
Copy the current selection to the clipboard.
Definition at line 369 of file kformulacontainer.cc. References activeCursor(), FormulaCursor::copy(), Document::createDomDocument(), and document(). Referenced by cut(). |
|
Copy and remove.
Definition at line 381 of file kformulacontainer.cc. References activeCursor(), copy(), and FormulaCursor::isSelection(). |
|
Definition at line 106 of file kformulacontainer.cc. Referenced by baseline(), boundingRect(), coveredRect(), createCursor(), draw(), isEmpty(), load(), moveTo(), print(), recalc(), save(), saveMathML(), setFontSize(), and texString(). |
|
Factory method.
Definition at line 135 of file kformulacontainer.cc. Referenced by initialize(), and load(). |
The documentation for this class was generated from the following files: