lib

IndexElement Class Reference

#include <indexelement.h>

Inheritance diagram for IndexElement:

BasicElement List of all members.

Detailed Description

The element with up to four indexes in the four corners.

Definition at line 34 of file indexelement.h.


Public Member Functions

 IndexElement (BasicElement *parent=0)
 ~IndexElement ()
 IndexElement (const IndexElement &)
virtual IndexElementclone ()
virtual bool accept (ElementVisitor *visitor)
virtual QChar getCharacter () const
virtual void entered (SequenceElement *child)
virtual BasicElementgoToPos (FormulaCursor *, bool &handled, const LuPixelPoint &point, const LuPixelPoint &parentOrigin)
virtual void calcSizes (const ContextStyle &style, 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 *cursor, BasicElement *from)
virtual void moveDown (FormulaCursor *cursor, BasicElement *from)
virtual SequenceElementgetMainChild ()
SequenceElementgetExponent ()
virtual void insert (FormulaCursor *, QPtrList< BasicElement > &, Direction)
virtual void remove (FormulaCursor *, QPtrList< BasicElement > &, Direction)
virtual void normalize (FormulaCursor *, Direction)
virtual BasicElementgetChild (FormulaCursor *, Direction=beforeCursor)
virtual void selectChild (FormulaCursor *cursor, BasicElement *child)
virtual bool isSenseless ()
bool hasUpperLeft () const
bool hasUpperMiddle () const
bool hasUpperRight () const
bool hasLowerLeft () const
bool hasLowerMiddle () const
bool hasLowerRight () const
void setToUpperLeft (FormulaCursor *cursor)
void setToUpperMiddle (FormulaCursor *cursor)
void setToUpperRight (FormulaCursor *cursor)
void setToLowerLeft (FormulaCursor *cursor)
void setToLowerMiddle (FormulaCursor *cursor)
void setToLowerRight (FormulaCursor *cursor)
void moveToUpperLeft (FormulaCursor *cursor, Direction direction)
void moveToUpperMiddle (FormulaCursor *cursor, Direction direction)
void moveToUpperRight (FormulaCursor *cursor, Direction direction)
void moveToLowerLeft (FormulaCursor *cursor, Direction direction)
void moveToLowerMiddle (FormulaCursor *cursor, Direction direction)
void moveToLowerRight (FormulaCursor *cursor, Direction direction)
ElementIndexPtr getUpperLeft ()
ElementIndexPtr getLowerLeft ()
ElementIndexPtr getUpperMiddle ()
ElementIndexPtr getLowerMiddle ()
ElementIndexPtr getUpperRight ()
ElementIndexPtr getLowerRight ()
ElementIndexPtr getIndex (int position)
virtual QString toLatex ()
virtual QString formulaString ()

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)

Member Function Documentation

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

Visit this element.

An implementation of the visitor pattern.

Implements BasicElement.

Definition at line 181 of file indexelement.cc.

QChar IndexElement::getCharacter (  )  const [virtual]

Returns:
the character that represents this element.

Used for parsing a sequence. This is guaranteed to be QChar::null for all non-text elements.

Reimplemented from BasicElement.

Definition at line 187 of file indexelement.cc.

void IndexElement::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 215 of file indexelement.cc.

BasicElement * IndexElement::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 229 of file indexelement.cc.

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

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

Implements BasicElement.

Definition at line 346 of file indexelement.cc.

void IndexElement::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 549 of file indexelement.cc.

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

Dispatch this FontCommand to all our TextElement children.

Reimplemented from BasicElement.

Definition at line 593 of file indexelement.cc.

void IndexElement::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 656 of file indexelement.cc.

void IndexElement::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 727 of file indexelement.cc.

void IndexElement::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 798 of file indexelement.cc.

void IndexElement::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 845 of file indexelement.cc.

virtual SequenceElement* IndexElement::getMainChild (  )  [inline, 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 156 of file indexelement.h.

void IndexElement::insert ( FormulaCursor ,
QPtrList< BasicElement > &  ,
Direction   
) [virtual]

Inserts all new children at the cursor position.

Places the cursor according to the direction.

You only can insert one index at a time. So the list must contain exactly on SequenceElement. And the index you want to insert must not exist already.

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

Reimplemented from BasicElement.

Definition at line 914 of file indexelement.cc.

void IndexElement::remove ( FormulaCursor ,
QPtrList< BasicElement > &  ,
Direction   
) [virtual]

Removes all selected children and returns them.

Places the cursor to where the children have been.

The cursor has to be inside one of our indexes which is supposed to be empty. The index will be removed and the cursor will be placed to the removed index so it can be inserted again. This methode is called by SequenceElement::remove only.

The ownership of the list is passed to the caller.

Reimplemented from BasicElement.

Definition at line 967 of file indexelement.cc.

void IndexElement::normalize ( FormulaCursor ,
Direction   
) [virtual]

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

Reimplemented from BasicElement.

Definition at line 1023 of file indexelement.cc.

BasicElement * IndexElement::getChild ( FormulaCursor ,
Direction  = beforeCursor 
) [virtual]

Returns the child at the cursor.

Reimplemented from BasicElement.

Definition at line 1048 of file indexelement.cc.

void IndexElement::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 1081 of file indexelement.cc.

bool IndexElement::isSenseless (  )  [virtual]

Returns wether the element has no more useful children (except its main child) and should therefore be replaced by its main child's content.

Reimplemented from BasicElement.

Definition at line 1038 of file indexelement.cc.

ElementIndexPtr IndexElement::getIndex ( int  position  ) 

Returns the index at the position.

Defaults to upperRight.

Definition at line 1562 of file indexelement.cc.

QString IndexElement::toLatex (  )  [virtual]

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

Reimplemented from BasicElement.

Definition at line 1583 of file indexelement.cc.

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

Returns the tag name of this element type.

Reimplemented from BasicElement.

Definition at line 276 of file indexelement.h.

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

Appends our attributes to the dom element.

Reimplemented from BasicElement.

Definition at line 1230 of file indexelement.cc.

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

Reads our attributes from the element.

Returns false if it failed.

Reimplemented from BasicElement.

Definition at line 1276 of file indexelement.cc.

bool IndexElement::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 1289 of file indexelement.cc.

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

Reads our attributes from the MathML element.

Returns false if it failed.

Reimplemented from BasicElement.

Definition at line 1348 of file indexelement.cc.

int IndexElement::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 1411 of file indexelement.cc.


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