lib

MatrixElement Class Reference

#include <matrixelement.h>

Inheritance diagram for MatrixElement:

BasicElement List of all members.

Detailed Description

A matrix.

Definition at line 38 of file matrixelement.h.


Public Member Functions

 MatrixElement (uint rows=1, uint columns=1, BasicElement *parent=0)
 ~MatrixElement ()
 MatrixElement (const MatrixElement &)
virtual MatrixElementclone ()
virtual bool accept (ElementVisitor *visitor)
virtual void entered (SequenceElement *child)
virtual BasicElementgoToPos (FormulaCursor *, bool &handled, const LuPixelPoint &point, const LuPixelPoint &parentOrigin)
virtual void calcSizes (const ContextStyle &cstyle, 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)
virtual void dispatchFontCommand (FontCommand *cmd)
virtual void moveLeft (FormulaCursor *cursor, BasicElement *from)
virtual void moveRight (FormulaCursor *cursor, BasicElement *from)
virtual void moveUp (FormulaCursor *, BasicElement *)
virtual void moveDown (FormulaCursor *, BasicElement *)
virtual void goInside (FormulaCursor *cursor)
virtual SequenceElementgetMainChild ()
virtual void selectChild (FormulaCursor *, BasicElement *)
virtual QString toLatex ()
virtual QString formulaString ()
uint getRows () const
uint getColumns () const
SequenceElementelementAt (uint row, uint column)

Protected Member Functions

virtual QString getTagName () const
virtual void writeDom (QDomElement element)
virtual QString getElementName () const
virtual void writeMathMLAttributes (QDomElement &element) const
virtual void writeMathMLContent (QDomDocument &doc, QDomElement &element, bool oasisFormat) const
virtual bool readAttributesFromDom (QDomElement element)
virtual bool readContentFromDom (QDomNode &node)
virtual bool readAttributesFromMathMLDom (const QDomElement &element)
virtual int readContentFromMathMLDom (QDomNode &node)

Friends

class KFCRemoveColumn
class KFCRemoveRow
class MatrixSequenceElement

Member Function Documentation

bool MatrixElement::accept ( ElementVisitor visitor  )  [virtual]

Visit this element.

An implementation of the visitor pattern.

Implements BasicElement.

Definition at line 329 of file matrixelement.cc.

void MatrixElement::entered ( SequenceElement child  )  [virtual]

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 335 of file matrixelement.cc.

BasicElement * MatrixElement::goToPos ( FormulaCursor ,
bool &  handled,
const LuPixelPoint &  point,
const LuPixelPoint &  parentOrigin 
) [virtual]

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 341 of file matrixelement.cc.

void MatrixElement::calcSizes ( const ContextStyle cstyle,
ContextStyle::TextStyle  tstyle,
ContextStyle::IndexStyle  istyle,
StyleAttributes style 
) [virtual]

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

Implements BasicElement.

Definition at line 435 of file matrixelement.cc.

void MatrixElement::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.

Implements BasicElement.

Definition at line 515 of file matrixelement.cc.

void MatrixElement::dispatchFontCommand ( FontCommand cmd  )  [virtual]

Dispatch this FontCommand to all our TextElement children.

Reimplemented from BasicElement.

Definition at line 545 of file matrixelement.cc.

void MatrixElement::moveLeft ( FormulaCursor cursor,
BasicElement from 
) [virtual]

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 571 of file matrixelement.cc.

void MatrixElement::moveRight ( FormulaCursor cursor,
BasicElement from 
) [virtual]

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 607 of file matrixelement.cc.

void MatrixElement::moveUp ( FormulaCursor ,
BasicElement  
) [virtual]

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 643 of file matrixelement.cc.

void MatrixElement::moveDown ( FormulaCursor ,
BasicElement  
) [virtual]

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 675 of file matrixelement.cc.

void MatrixElement::goInside ( FormulaCursor cursor  )  [virtual]

Sets the cursor inside this element to its start position.

For most elements that is the main child.

Reimplemented from BasicElement.

Definition at line 706 of file matrixelement.cc.

SequenceElement * MatrixElement::getMainChild (  )  [virtual]

We define the Main Child of a matrix to be the first row/column.

Reimplemented from BasicElement.

Definition at line 713 of file matrixelement.cc.

void MatrixElement::selectChild ( FormulaCursor ,
BasicElement  
) [virtual]

Sets the cursor to select the child.

The mark is placed before, the position behind it.

Reimplemented from BasicElement.

Definition at line 718 of file matrixelement.cc.

QString MatrixElement::toLatex (  )  [virtual]

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

Reimplemented from BasicElement.

Definition at line 1208 of file matrixelement.cc.

virtual QString MatrixElement::getTagName (  )  const [inline, protected, virtual]

Returns the tag name of this element type.

Reimplemented from BasicElement.

Definition at line 212 of file matrixelement.h.

void MatrixElement::writeDom ( QDomElement  element  )  [protected, virtual]

Appends our attributes to the dom element.

Reimplemented from BasicElement.

Definition at line 764 of file matrixelement.cc.

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

Reads our attributes from the element.

Returns false if it failed.

Reimplemented from BasicElement.

Definition at line 789 of file matrixelement.cc.

bool MatrixElement::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 BasicElement.

Definition at line 832 of file matrixelement.cc.

bool MatrixElement::readAttributesFromMathMLDom ( const QDomElement &  element  )  [protected, virtual]

Reads our attributes from the MathML element.

Returns false if it failed.

Reimplemented from BasicElement.

Definition at line 861 of file matrixelement.cc.

int MatrixElement::readContentFromMathMLDom ( QDomNode &  node  )  [protected, virtual]

Reads our content from the MathML node.

Sets the node to the next node that needs to be read. It is sometimes needed to read more than one node (e. g. for fence operators). Returns the number of nodes processed or -1 if it failed.

Reimplemented from BasicElement.

Definition at line 1118 of file matrixelement.cc.


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