lib

FormulaElement Class Reference

#include <formulaelement.h>

Inheritance diagram for FormulaElement:

SequenceElement BasicElement List of all members.

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 FormulaElementclone ()
BasicElementgoToPos (FormulaCursor *, const LuPixelPoint &point)
virtual bool readOnly (const BasicElement *) const
virtual bool readOnly (const FormulaCursor *) const
virtual FormulaElementformula ()
virtual const FormulaElementformula () 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 KCommandbuildCommand (Container *, Request *)
const SymbolTablegetSymbolTable () const
virtual QString toLatex ()
int getBaseSize () const
void setBaseSize (int size)
bool hasOwnBaseSize () const
virtual KCommandinput (Container *container, QKeyEvent *event)
virtual void writeMathML (QDomDocument &doc, QDomNode &parent, bool oasisFormat=false)
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

KCommand * FormulaElement::buildCommand ( Container ,
Request  
) [virtual]

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 170 of file formulaelement.cc.

void FormulaElement::calcSizes ( ContextStyle context  ) 

Calculates the formulas sizes and positions.

Definition at line 140 of file formulaelement.cc.

void FormulaElement::calcSizes ( const ContextStyle context,
ContextStyle::TextStyle  tstyle,
ContextStyle::IndexStyle  istyle 
) [virtual]

Calculates our width and height and our children's parentPosition.

Reimplemented from SequenceElement.

Definition at line 119 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::draw ( QPainter &  painter,
const LuPixelRect &  r,
ContextStyle context 
)

Draws the whole thing.

Definition at line 156 of file formulaelement.cc.

void FormulaElement::draw ( QPainter &  painter,
const LuPixelRect &  r,
const ContextStyle context,
ContextStyle::TextStyle  tstyle,
ContextStyle::IndexStyle  istyle,
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 127 of file formulaelement.cc.

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.

QDomElement FormulaElement::emptyFormulaElement ( QDomDocument &  doc  ) 

For copy&paste we need to create an empty XML element.

Definition at line 187 of file formulaelement.cc.

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.

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.

const SymbolTable & FormulaElement::getSymbolTable (  )  const

Returns:
our documents symbol table

Definition at line 181 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 190 of file formulaelement.h.

BasicElement * FormulaElement::goToPos ( FormulaCursor ,
const LuPixelPoint &  point 
)

Returns the element the point is in.

Definition at line 56 of file formulaelement.cc.

KCommand * FormulaElement::input ( Container container,
QKeyEvent *  event 
) [virtual]

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.

bool FormulaElement::readAttributesFromDom ( QDomElement  element  )  [protected, virtual]

Reads our attributes from the element.

Returns false if it failed.

Reimplemented from SequenceElement.

Definition at line 235 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 268 of file formulaelement.cc.

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 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.

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::tell ( const QString &  msg  ) 

Tell the user something has happened.

Definition at line 104 of file formulaelement.cc.

QString FormulaElement::toLatex (  )  [virtual]

Returns:
the latex representation of the element and of the element's children

Reimplemented from SequenceElement.

Definition at line 308 of file formulaelement.cc.

void FormulaElement::writeDom ( QDomElement  element  )  [virtual]

Appends our attributes to the dom element.

Reimplemented from SequenceElement.

Definition at line 222 of file formulaelement.cc.

void FormulaElement::writeMathML ( QDomDocument &  doc,
QDomNode &  parent,
bool  oasisFormat = false 
) [virtual]

Same as above, just MathML.

Reimplemented from SequenceElement.

Definition at line 313 of file formulaelement.cc.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys