lib

#include <textelement.h>

Inheritance diagram for TextElement:
BasicElement

Public Member Functions

 TextElement (TQChar ch=' ', bool beSymbol=false, BasicElement *parent=0)
 
 TextElement (const TextElement &)
 
virtual TextElement * clone ()
 
virtual bool accept (ElementVisitor *visitor)
 
virtual TokenType getTokenType () const
 
virtual bool isInvisible () const
 
virtual TQChar getCharacter () const
 
virtual void calcSizes (const ContextStyle &cstyle, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes &style)
 
virtual void draw (TQPainter &painter, const LuPixelRect &r, const ContextStyle &context, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes &style, const LuPixelPoint &parentOrigin)
 
virtual void dispatchFontCommand (FontCommand *cmd)
 
void setColor (TQColor c)
 
CharStyle getCharStyle () const
 
void setCharStyle (CharStyle cs)
 
CharFamily getCharFamily () const
 
void setCharFamily (CharFamily cf)
 
char format () const
 
bool isSymbol () const
 
virtual TQString toLatex ()
 
virtual TQString formulaString ()
 
virtual void writeMathML (TQDomDocument &doc, TQDomNode &parent, bool oasisFormat=false) const
 
- Public Member Functions inherited from BasicElement
 BasicElement (BasicElement *parent=0)
 
 BasicElement (const BasicElement &)
 
virtual bool readOnly (const BasicElement *child) const
 
virtual FormulaElement * formula ()
 
virtual const FormulaElement * formula () const
 
virtual BasicElement * goToPos (FormulaCursor *, bool &handled, const LuPixelPoint &point, const LuPixelPoint &parentOrigin)
 
LuPixelPoint widgetPos ()
 
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 moveHome (FormulaCursor *)
 
virtual void moveEnd (FormulaCursor *)
 
virtual void goInside (FormulaCursor *cursor)
 
virtual void entered (SequenceElement *)
 
virtual SequenceElement * getMainChild ()
 
virtual void insert (FormulaCursor *, TQPtrList< BasicElement > &, Direction)
 
virtual void remove (FormulaCursor *, TQPtrList< BasicElement > &, Direction)
 
virtual void normalize (FormulaCursor *, Direction)
 
virtual bool isSenseless ()
 
virtual BasicElement * getChild (FormulaCursor *, Direction=beforeCursor)
 
virtual void selectChild (FormulaCursor *, BasicElement *)
 
virtual void childWillVanish (FormulaCursor *, BasicElement *)
 
virtual void registerTab (BasicElement *)
 
virtual KCommand * buildCommand (Container *, Request *)
 
virtual KCommand * input (Container *, TQKeyEvent *)
 
const BasicElement * getParent () const
 
BasicElement * getParent ()
 
void setParent (BasicElement *p)
 
luPixel getX () const
 
luPixel getY () const
 
void setX (luPixel x)
 
void setY (luPixel y)
 
luPixel getWidth () const
 
luPixel getHeight () const
 
void setWidth (luPixel width)
 
void setHeight (luPixel height)
 
luPixel getBaseline () const
 
void setBaseline (luPixel line)
 
luPixel axis (const ContextStyle &style, ContextStyle::TextStyle tstyle, double factor) const
 
TQDomElement getElementDom (TQDomDocument &doc)
 
bool buildFromDom (TQDomElement element)
 
int buildFromMathMLDom (TQDomElement element)
 
ElementType * getElementType () const
 
virtual void setElementType (ElementType *t)
 
virtual void setStyle (StyleElement *)
 
virtual TQString getElementName () const
 

Protected Member Functions

virtual TQString getTagName () const
 
virtual void writeDom (TQDomElement element)
 
virtual bool readAttributesFromDom (TQDomElement element)
 
virtual bool readContentFromDom (TQDomNode &node)
 
TQChar getRealCharacter (const ContextStyle &context)
 
TQFont getFont (const ContextStyle &context, const StyleAttributes &style)
 
void setUpPainter (const ContextStyle &context, TQPainter &painter)
 
const SymbolTable & getSymbolTable () const
 
- Protected Member Functions inherited from BasicElement
virtual void writeMathMLAttributes (TQDomElement &) const
 
virtual void writeMathMLContent (TQDomDocument &, TQDomElement &, bool) const
 
bool buildChild (SequenceElement *child, TQDomNode node, TQString name)
 
virtual bool readAttributesFromMathMLDom (const TQDomElement &element)
 
virtual int readContentFromMathMLDom (TQDomNode &node)
 
double getSize (const TQString &str, SizeType *st)
 
SizeType getSpace (const TQString &str)
 

Additional Inherited Members

- Static Public Member Functions inherited from BasicElement
static int getEvilDestructionCount ()
 

Detailed Description

An element that represents one char.

Definition at line 37 of file textelement.h.

Constructor & Destructor Documentation

◆ TextElement() [1/2]

KFORMULA_NAMESPACE_BEGIN TextElement::TextElement ( TQChar  ch = ' ',
bool  beSymbol = false,
BasicElement *  parent = 0 
)

Definition at line 40 of file textelement.cpp.

◆ TextElement() [2/2]

TextElement::TextElement ( const TextElement &  other)

Definition at line 48 of file textelement.cpp.

Member Function Documentation

◆ accept()

bool TextElement::accept ( ElementVisitor *  )
virtual

Visit this element.

An implementation of the visitor pattern.

Implements BasicElement.

Definition at line 57 of file textelement.cpp.

◆ calcSizes()

void TextElement::calcSizes ( const ContextStyle &  cstyle,
ContextStyle::TextStyle  tstyle,
ContextStyle::IndexStyle  istyle,
StyleAttributes &  style 
)
virtual

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

Implements BasicElement.

Definition at line 111 of file textelement.cpp.

◆ clone()

virtual TextElement * TextElement::clone ( )
inlinevirtual

Implements BasicElement.

Definition at line 44 of file textelement.h.

◆ dispatchFontCommand()

void TextElement::dispatchFontCommand ( FontCommand *  cmd)
virtual

Dispatch this FontCommand to all our TextElement children.

Reimplemented from BasicElement.

Definition at line 258 of file textelement.cpp.

◆ draw()

void TextElement::draw ( TQPainter &  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 162 of file textelement.cpp.

◆ format()

char TextElement::format ( ) const
inline

Definition at line 111 of file textelement.h.

◆ formulaString()

TQString TextElement::formulaString ( )
virtual

Reimplemented from BasicElement.

Definition at line 490 of file textelement.cpp.

◆ getCharacter()

virtual TQChar TextElement::getCharacter ( ) const
inlinevirtual
Returns
the character that represents this element. Used for parsing a sequence.

Reimplemented from BasicElement.

Definition at line 65 of file textelement.h.

◆ getCharFamily()

CharFamily TextElement::getCharFamily ( ) const
inline

Definition at line 108 of file textelement.h.

◆ getCharStyle()

CharStyle TextElement::getCharStyle ( ) const
inline

Definition at line 105 of file textelement.h.

◆ getFont()

TQFont TextElement::getFont ( const ContextStyle &  context,
const StyleAttributes &  style 
)
protected
Returns
the font to be used for the element.

Definition at line 299 of file textelement.cpp.

◆ getRealCharacter()

TQChar TextElement::getRealCharacter ( const ContextStyle &  context)
protected
Returns
the char that is used to draw with the given font.

Definition at line 275 of file textelement.cpp.

◆ getSymbolTable()

const SymbolTable & TextElement::getSymbolTable ( ) const
protected

Definition at line 348 of file textelement.cpp.

◆ getTagName()

virtual TQString TextElement::getTagName ( ) const
inlineprotectedvirtual
Returns
the tag name of this element type.

Reimplemented from BasicElement.

Definition at line 141 of file textelement.h.

◆ getTokenType()

TokenType TextElement::getTokenType ( ) const
virtual
Returns
the type of this element. Used for parsing a sequence.

Reimplemented from BasicElement.

Definition at line 63 of file textelement.cpp.

◆ isInvisible()

bool TextElement::isInvisible ( ) const
virtual
Returns
true if we don't want to see the element.

Reimplemented from BasicElement.

Definition at line 98 of file textelement.cpp.

◆ isSymbol()

bool TextElement::isSymbol ( ) const
inline

Moves the cursor away from the given child.

The cursor is guaranteed to be inside this element.

Returns
whether we are a symbol (greek letter).

Definition at line 122 of file textelement.h.

◆ readAttributesFromDom()

bool TextElement::readAttributesFromDom ( TQDomElement  element)
protectedvirtual

Reads our attributes from the element.

Returns false if it failed.

Reimplemented from BasicElement.

Definition at line 391 of file textelement.cpp.

◆ readContentFromDom()

bool TextElement::readContentFromDom ( TQDomNode &  node)
protectedvirtual

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 472 of file textelement.cpp.

◆ setCharFamily()

void TextElement::setCharFamily ( CharFamily  cf)

Definition at line 269 of file textelement.cpp.

◆ setCharStyle()

void TextElement::setCharStyle ( CharStyle  cs)

Definition at line 263 of file textelement.cpp.

◆ setColor()

void TextElement::setColor ( TQColor  c)
inline

Set the color to use to display.

Definition at line 103 of file textelement.h.

◆ setUpPainter()

void TextElement::setUpPainter ( const ContextStyle &  context,
TQPainter &  painter 
)
protected

Sets up the painter to be used for drawing.

Definition at line 338 of file textelement.cpp.

◆ toLatex()

TQString TextElement::toLatex ( )
virtual
Returns
the latex representation of the element and of the element's children

Reimplemented from BasicElement.

Definition at line 477 of file textelement.cpp.

◆ writeDom()

void TextElement::writeDom ( TQDomElement  element)
protectedvirtual

Appends our attributes to the dom element.

Reimplemented from BasicElement.

Definition at line 362 of file textelement.cpp.

◆ writeMathML()

void TextElement::writeMathML ( TQDomDocument &  doc,
TQDomNode &  parent,
bool  oasisFormat = false 
) const
virtual

Same as above, just MathML.

It shouldn't be redefined but for exceptional cases, use the general writeMathML* API instead

Reimplemented from BasicElement.

Definition at line 354 of file textelement.cpp.


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