lib

BracketElement Class Reference

#include <bracketelement.h>

Inheritance diagram for BracketElement:

SingleContentElement BasicElement List of all members.

Detailed Description

A left and/or right bracket around one child.

Definition at line 153 of file bracketelement.h.


Public Types

 contentPos
enum  { contentPos }

Public Member Functions

 BracketElement (SymbolType left=EmptyBracket, SymbolType right=EmptyBracket, BasicElement *parent=0)
 ~BracketElement ()
 BracketElement (const BracketElement &)
virtual BracketElementclone ()
virtual bool accept (ElementVisitor *visitor)
virtual TokenType getTokenType () 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)
virtual void draw (QPainter &painter, const LuPixelRect &r, const ContextStyle &style, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, const LuPixelPoint &parentOrigin)
virtual void writeMathML (QDomDocument &doc, QDomNode &parent, bool oasisFormat=false)

Protected Member Functions

virtual QString getTagName () const
virtual bool readAttributesFromDom (QDomElement element)
virtual void writeDom (QDomElement element)
virtual QString toLatex ()
virtual QString formulaString ()

Member Function Documentation

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

Visit this element.

An implementation of the visitor pattern.

Implements BasicElement.

Definition at line 224 of file bracketelement.cc.

void BracketElement::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 268 of file bracketelement.cc.

void BracketElement::draw ( QPainter &  painter,
const LuPixelRect &  r,
const ContextStyle style,
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 345 of file bracketelement.cc.

void BracketElement::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 230 of file bracketelement.cc.

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

Returns the tag name of this element type.

Reimplemented from BasicElement.

Definition at line 218 of file bracketelement.h.

virtual TokenType BracketElement::getTokenType (  )  const [inline, virtual]

Returns:
the type of this element. Used for parsing a sequence.

Reimplemented from BasicElement.

Definition at line 175 of file bracketelement.h.

BasicElement * BracketElement::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 SingleContentElement.

Definition at line 236 of file bracketelement.cc.

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

Reads our attributes from the element.

Returns false if it failed.

Reimplemented from BasicElement.

Definition at line 399 of file bracketelement.cc.

QString BracketElement::toLatex (  )  [protected, virtual]

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

Reimplemented from BasicElement.

Definition at line 415 of file bracketelement.cc.

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

Appends our attributes to the dom element.

Reimplemented from SingleContentElement.

Definition at line 388 of file bracketelement.cc.

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

Same as above, just MathML.

Reimplemented from SingleContentElement.

Definition at line 459 of file bracketelement.cc.


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