lib Library API Documentation

MatrixElement Class Reference

A matrix. More...

#include <matrixelement.h>

Inheritance diagram for MatrixElement:

BasicElement List of all members.

Public Member Functions

 MatrixElement (uint rows=1, uint columns=1, BasicElement *parent=0)
 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 &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)
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)
virtual void writeMathML (QDomDocument doc, QDomNode parent)

Protected Member Functions

virtual QString getTagName () const
virtual void writeDom (QDomElement element)
virtual bool readAttributesFromDom (QDomElement element)
virtual bool readContentFromDom (QDomNode &node)

Detailed Description

A matrix.

Definition at line 37 of file matrixelement.h.


Member Function Documentation

bool MatrixElement::accept ElementVisitor visitor  )  [virtual]
 

Visit this element.

An implementation of the visitor pattern.

Implements BasicElement.

Definition at line 318 of file matrixelement.cc.

References accept(), and ElementVisitor::visit().

Referenced by accept().

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

References entered(), BasicElement::formula(), and FormulaElement::tell().

Referenced by entered().

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

References BasicElement::getX(), BasicElement::getY(), BasicElement::goToPos(), goToPos(), and BasicElement::moveLeft().

Referenced by goToPos().

void MatrixElement::calcSizes const ContextStyle style,
ContextStyle::TextStyle  tstyle,
ContextStyle::IndexStyle  istyle
[virtual]
 

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

Implements BasicElement.

Definition at line 424 of file matrixelement.cc.

References BasicElement::axis(), SequenceElement::calcSizes(), calcSizes(), BasicElement::getHeight(), getMainChild(), BasicElement::getWidth(), BasicElement::setX(), and BasicElement::setY().

Referenced by calcSizes().

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

Implements BasicElement.

Definition at line 500 of file matrixelement.cc.

References draw().

Referenced by draw().

void MatrixElement::dispatchFontCommand FontCommand cmd  )  [virtual]
 

Dispatch this FontCommand to all our TextElement children.

Reimplemented from BasicElement.

Definition at line 528 of file matrixelement.cc.

References dispatchFontCommand().

Referenced by dispatchFontCommand().

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

References FormulaCursor::getLinearMovement(), FormulaCursor::isSelectionMode(), and moveLeft().

Referenced by moveLeft().

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

References FormulaCursor::getLinearMovement(), FormulaCursor::isSelectionMode(), and moveRight().

Referenced by moveRight().

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

References FormulaCursor::isSelectionMode(), and moveUp().

Referenced by moveUp().

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

References FormulaCursor::isSelectionMode(), and moveDown().

Referenced by moveDown().

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

References goInside().

Referenced by goInside().

SequenceElement * MatrixElement::getMainChild  )  [virtual]
 

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

Reimplemented from BasicElement.

Definition at line 696 of file matrixelement.cc.

Referenced by calcSizes().

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

References selectChild(), and FormulaCursor::setTo().

Referenced by selectChild().

QString MatrixElement::toLatex  )  [virtual]
 

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

Reimplemented from BasicElement.

Definition at line 831 of file matrixelement.cc.

void MatrixElement::writeMathML QDomDocument  doc,
QDomNode  parent
[virtual]
 

Same as above, just MathML.

Reimplemented from BasicElement.

Definition at line 883 of file matrixelement.cc.

References writeMathML().

Referenced by writeMathML().

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

Returns the tag name of this element type.

Reimplemented from BasicElement.

Definition at line 206 of file matrixelement.h.

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

Appends our attributes to the dom element.

Reimplemented from BasicElement.

Definition at line 734 of file matrixelement.cc.

References writeDom().

Referenced by writeDom().

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

Reads our attributes from the element.

Returns false if it failed.

Reimplemented from BasicElement.

Definition at line 759 of file matrixelement.cc.

References readAttributesFromDom().

Referenced by readAttributesFromDom().

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

References BasicElement::buildFromDom(), and readContentFromDom().

Referenced by readContentFromDom().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for lib Library Version 1.3.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Sep 28 04:04:04 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003