kformula/flake

RowElement Class Reference

Implementation of the MathML mrow element. More...

#include <RowElement.h>

Inheritance diagram for RowElement:

List of all members.

Public Member Functions

 RowElement (BasicElement *parent=0)
virtual ~RowElement ()
bool acceptCursor (const FormulaCursor &cursor)
const QList< BasicElement * > childElements () const
virtual QLineF cursorLine (int position) const
virtual BasicElementelementAfter (int position) const
virtual BasicElementelementBefore (int position) const
virtual QList< BasicElement * > elementsBetween (int pos1, int pos2) const
ElementType elementType () const
virtual int endPosition () const
virtual bool insertChild (int position, BasicElement *child)
virtual bool isEmpty () const
virtual bool isInferredRow () const
virtual void layout (const AttributeManager *am)
virtual bool moveCursor (FormulaCursor &newcursor, FormulaCursor &oldcursor)
virtual void paint (QPainter &painter, AttributeManager *am)
virtual void paintEditingHints (QPainter &painter, AttributeManager *am)
virtual int positionOfChild (BasicElement *child) const
bool removeChild (BasicElement *child)
virtual bool replaceChild (BasicElement *oldelement, BasicElement *newelement)
virtual bool setCursorTo (FormulaCursor &cursor, QPointF point)
virtual void stretch ()

Protected Member Functions

bool readMathMLContent (const KoXmlElement &parent)
void writeMathMLContent (KoXmlWriter *writer) const

Protected Attributes

QList< BasicElement * > m_childElements

Detailed Description

Implementation of the MathML mrow element.

The mrow element is specified in the MathML spec section 3.3.1. It primarily serves as container for other elements that are grouped together and aligned in a row. mrow has no own visual representance that is why the paint() method is empty. The handling of background and other global attributes is done generically inside FormulaRenderer. The layout() method implements the layouting and size calculation for the mrow element. The calculations assume that spacing is done per element and therefore do not handle it. At the moment there is no linebreaking implementation in RowElement.

Definition at line 45 of file RowElement.h.


Constructor & Destructor Documentation

RowElement::RowElement ( BasicElement parent = 0  ) 

The standard constructor.

Definition at line 31 of file RowElement.cpp.

RowElement::~RowElement (  )  [virtual]

The standard destructor.

Definition at line 34 of file RowElement.cpp.


Member Function Documentation

bool RowElement::acceptCursor ( const FormulaCursor cursor  )  [virtual]

Implement the cursor behaviour for the element.

Parameters:
direction Indicates whether the cursor moves up, down, right or left
Returns:
A this pointer if the element accepts if not the element to asked instead

Reimplemented from BasicElement.

Definition at line 137 of file RowElement.cpp.

const QList< BasicElement * > RowElement::childElements (  )  const [virtual]

Obtain a list of all child elements of this element.

Returns:
a QList with pointers to all child elements

Reimplemented from BasicElement.

Definition at line 112 of file RowElement.cpp.

QLineF RowElement::cursorLine ( int  position  )  const [virtual]

inherited from BasicElement

Reimplemented from BasicElement.

Definition at line 182 of file RowElement.cpp.

BasicElement * RowElement::elementAfter ( int  position  )  const [virtual]

inherited from BasicElement

Reimplemented from BasicElement.

Definition at line 277 of file RowElement.cpp.

BasicElement * RowElement::elementBefore ( int  position  )  const [virtual]

inherited from BasicElement

Reimplemented from BasicElement.

Definition at line 286 of file RowElement.cpp.

QList< BasicElement * > RowElement::elementsBetween ( int  pos1,
int  pos2 
) const [virtual]

inherited from BasicElement

Reimplemented from BasicElement.

Definition at line 295 of file RowElement.cpp.

ElementType RowElement::elementType (  )  const [virtual]
Returns:
The element's ElementType

Reimplemented from BasicElement.

Reimplemented in ActionElement, EncloseElement, ErrorElement, FencedElement, FormulaElement, PaddedElement, PhantomElement, SquareRootElement, StyleElement, and TableEntryElement.

Definition at line 230 of file RowElement.cpp.

int RowElement::endPosition (  )  const [virtual]

inherited from BasicElement

Reimplemented from BasicElement.

Definition at line 107 of file RowElement.cpp.

bool RowElement::insertChild ( int  position,
BasicElement child 
) [virtual]

inherited from BasicElement

Definition at line 117 of file RowElement.cpp.

bool RowElement::isEmpty (  )  const [virtual]

inherited from BasicElement

Reimplemented from BasicElement.

Definition at line 313 of file RowElement.cpp.

bool RowElement::isInferredRow (  )  const [virtual]

inherited from Basic

Reimplemented from BasicElement.

Definition at line 319 of file RowElement.cpp.

void RowElement::layout ( const AttributeManager am  )  [virtual]

Calculate the size of the element and the positions of its children.

Parameters:
am The AttributeManager providing information about attributes values

Reimplemented from BasicElement.

Reimplemented in EncloseElement, FencedElement, PaddedElement, and SquareRootElement.

Definition at line 60 of file RowElement.cpp.

bool RowElement::moveCursor ( FormulaCursor newcursor,
FormulaCursor oldcursor 
) [virtual]

inherited from BasicElement

Reimplemented from BasicElement.

Reimplemented in TableEntryElement.

Definition at line 143 of file RowElement.cpp.

void RowElement::paint ( QPainter painter,
AttributeManager am 
) [virtual]

Render the element to the given QPainter.

Parameters:
painter The QPainter to paint the element to
am AttributeManager containing style info

Reimplemented from BasicElement.

Reimplemented in EncloseElement, ErrorElement, FencedElement, and SquareRootElement.

Definition at line 39 of file RowElement.cpp.

void RowElement::paintEditingHints ( QPainter painter,
AttributeManager am 
) [virtual]

inherited from BasicElement

Reimplemented from BasicElement.

Definition at line 46 of file RowElement.cpp.

int RowElement::positionOfChild ( BasicElement child  )  const [virtual]

inherited from BasicElement

Definition at line 267 of file RowElement.cpp.

bool RowElement::readMathMLContent ( const KoXmlElement &  parent  )  [protected, virtual]

Read contents of the row element.

Reimplemented from BasicElement.

Definition at line 235 of file RowElement.cpp.

bool RowElement::removeChild ( BasicElement child  ) 

Remove a child element.

Parameters:
element The BasicElement to remove

Definition at line 128 of file RowElement.cpp.

bool RowElement::replaceChild ( BasicElement oldelement,
BasicElement newelement 
) [virtual]

inherited form BasicElement

Definition at line 301 of file RowElement.cpp.

bool RowElement::setCursorTo ( FormulaCursor cursor,
QPointF  point 
) [virtual]

inherited from BasicElement

Reimplemented from BasicElement.

Definition at line 198 of file RowElement.cpp.

void RowElement::stretch (  )  [virtual]

Reimplemented from parent class.

This stretches the children inside, then readjusts their vertical offsets

Reimplemented from BasicElement.

Definition at line 94 of file RowElement.cpp.

void RowElement::writeMathMLContent ( KoXmlWriter *  writer  )  const [protected, virtual]

Write all content to the KoXmlWriter - reimplemented by the child elements.

Reimplemented from BasicElement.

Definition at line 271 of file RowElement.cpp.


Member Data Documentation

A list of the child elements.

Definition at line 141 of file RowElement.h.


The documentation for this class was generated from the following files: