lib Library API Documentation

MultilineElement Class Reference

Any number of lines. More...

#include <matrixelement.h>

Inheritance diagram for MultilineElement:

Inheritance graph
[legend]
Collaboration diagram for MultilineElement:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MultilineElement (BasicElement *parent=0)
 MultilineElement (const MultilineElement &)
virtual MultilineElement * clone ()
virtual bool accept (ElementVisitor *visitor)
virtual void entered (SequenceElement *child)
BasicElement * goToPos (FormulaCursor *cursor, bool &handled, const LuPixelPoint &point, const LuPixelPoint &parentOrigin)
virtual void goInside (FormulaCursor *cursor)
virtual void moveLeft (FormulaCursor *cursor, BasicElement *from)
virtual void moveRight (FormulaCursor *cursor, BasicElement *from)
virtual void moveUp (FormulaCursor *cursor, BasicElement *from)
virtual void moveDown (FormulaCursor *cursor, BasicElement *from)
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 insert (FormulaCursor *, QPtrList< BasicElement > &, Direction)
virtual void remove (FormulaCursor *, QPtrList< BasicElement > &, Direction)
virtual void normalize (FormulaCursor *, Direction)
virtual SequenceElement * getMainChild ()
virtual void selectChild (FormulaCursor *cursor, BasicElement *child)
virtual QString toLatex ()
virtual QString formulaString ()
virtual void writeMathML (QDomDocument &doc, QDomNode parent, bool oasisFormat=false)

Protected Member Functions

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

Friends

class KFCNewLine

Detailed Description

Any number of lines.

Definition at line 252 of file matrixelement.h.


Constructor & Destructor Documentation

MultilineElement::MultilineElement (  BasicElement *  parent = 0  ) 
 

The container this FormulaElement belongs to must not be 0, except you really know what you are doing.

Definition at line 1262 of file matrixelement.cc.


Member Function Documentation

bool MultilineElement::accept (  ElementVisitor *  visitor  )  [virtual]
 

Visit this element.

An implementation of the visitor pattern.

Implements BasicElement.

Definition at line 1286 of file matrixelement.cc.

void MultilineElement::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 1292 of file matrixelement.cc.

References BasicElement::formula().

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

Returns the element the point is in.

Reimplemented from BasicElement.

Definition at line 1301 of file matrixelement.cc.

References BasicElement::goToPos().

void MultilineElement::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 1322 of file matrixelement.cc.

void MultilineElement::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 1327 of file matrixelement.cc.

void MultilineElement::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 1360 of file matrixelement.cc.

References FormulaCursor::isSelectionMode().

void MultilineElement::moveUp (  FormulaCursor *  cursor,
BasicElement *  from
)  [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 1389 of file matrixelement.cc.

References FormulaCursor::getPos(), FormulaCursor::isSelectionMode(), and FormulaCursor::setTo().

void MultilineElement::moveDown (  FormulaCursor *  cursor,
BasicElement *  from
)  [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 1451 of file matrixelement.cc.

References FormulaCursor::getPos(), FormulaCursor::isSelectionMode(), and FormulaCursor::setTo().

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

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

Implements BasicElement.

Definition at line 1510 of file matrixelement.cc.

References ContextStyle::axisHeight(), ContextStyle::getAdjustedSize(), ContextStyle::getDefaultFont(), ContextStyle::getThinSpace(), KoTextZoomHandler::layoutUnitPtToPt(), KoTextZoomHandler::ptToLayoutUnitPt(), and KoZoomHandler::ptToPixelY().

void MultilineElement::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 1569 of file matrixelement.cc.

References ContextStyle::edit(), ContextStyle::getHelpColor(), BasicElement::getX(), KoZoomHandler::layoutUnitToPixelX(), and KoZoomHandler::layoutUnitToPixelY().

void MultilineElement::dispatchFontCommand (  FontCommand *  cmd  )  [virtual]
 

Dispatch this FontCommand to all our TextElement children.

Reimplemented from BasicElement.

Definition at line 1603 of file matrixelement.cc.

void MultilineElement::insert (  FormulaCursor *  cursor,
QPtrList< BasicElement > &  newChildren,
Direction  direction
)  [virtual]
 

Inserts all new children at the cursor position.

Places the cursor according to the direction.

The list will be emptied but stays the property of the caller.

Reimplemented from BasicElement.

Definition at line 1612 of file matrixelement.cc.

References BasicElement::formula().

void MultilineElement::remove (  FormulaCursor *  cursor,
QPtrList< BasicElement > &  removedChildren,
Direction  direction
)  [virtual]
 

Removes all selected children and returns them.

Places the cursor to where the children have been.

Reimplemented from BasicElement.

Definition at line 1630 of file matrixelement.cc.

References BasicElement::formula(), and FormulaCursor::getPos().

void MultilineElement::normalize (  FormulaCursor *  ,
Direction 
)  [virtual]
 

Moves the cursor to a normal place where new elements might be inserted.

Reimplemented from BasicElement.

Definition at line 1647 of file matrixelement.cc.

References FormulaCursor::getElement(), FormulaCursor::getPos(), and BasicElement::normalize().

SequenceElement * MultilineElement::getMainChild (   )  [virtual]
 

Removes the child.

If this was the main child this element might request its own removal. The cursor is the one that caused the removal. It has to be moved to the place any user expects the cursor after that particular element has been removed.

Reimplemented from BasicElement.

Definition at line 1674 of file matrixelement.cc.

void MultilineElement::selectChild (  FormulaCursor *  cursor,
BasicElement *  child
)  [virtual]
 

Sets the cursor to select the child.

The mark is placed before, the position behind it.

Reimplemented from BasicElement.

Definition at line 1679 of file matrixelement.cc.

References FormulaCursor::setTo().

QString MultilineElement::toLatex (   )  [virtual]
 

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

Reimplemented from BasicElement.

Definition at line 1778 of file matrixelement.cc.

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

Same as above, just MathML.

Reimplemented from BasicElement.

Definition at line 1706 of file matrixelement.cc.

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

Returns the tag name of this element type.

Reimplemented from BasicElement.

Definition at line 371 of file matrixelement.h.

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

Appends our attributes to the dom element.

Reimplemented from BasicElement.

Definition at line 1692 of file matrixelement.cc.

References BasicElement::writeDom().

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

Reads our attributes from the element.

Returns false if it failed.

Reimplemented from BasicElement.

Definition at line 1728 of file matrixelement.cc.

References BasicElement::readAttributesFromDom().

bool MultilineElement::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 1756 of file matrixelement.cc.

References BasicElement::buildFromDom(), and BasicElement::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.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:40:42 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003