lib

#include <tokenstyleelement.h>

Inheritance diagram for TokenStyleElement:
SequenceElement BasicElement

Public Member Functions

 TokenStyleElement (BasicElement *parent=0)
virtual void calcSizes (const ContextStyle &context, 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)
Public Member Functions inherited from SequenceElement
 SequenceElement (BasicElement *parent=0)
 SequenceElement (const SequenceElement &)
virtual SequenceElement * clone ()
virtual bool accept (ElementVisitor *visitor)
virtual bool readOnly (const FormulaCursor *) const
virtual bool isTextOnly () const
virtual BasicElement * goToPos (FormulaCursor *, bool &handled, const LuPixelPoint &point, const LuPixelPoint &parentOrigin)
void setSizeReduction (const ContextStyle &context)
bool isEmpty ()
virtual void dispatchFontCommand (FontCommand *cmd)
virtual void drawEmptyRect (TQPainter &painter, const ContextStyle &context, double factor, const LuPixelPoint &upperLeft)
virtual void calcCursorSize (const ContextStyle &context, FormulaCursor *cursor, bool smallCursor)
virtual void drawCursor (TQPainter &painter, const ContextStyle &context, StyleAttributes &style, FormulaCursor *cursor, bool smallCursor, bool activeCursor)
virtual void moveWordLeft (FormulaCursor *cursor)
virtual void moveWordRight (FormulaCursor *cursor)
virtual void moveHome (FormulaCursor *cursor)
virtual void moveEnd (FormulaCursor *cursor)
virtual void goInside (FormulaCursor *cursor)
virtual void goInsideLast (FormulaCursor *cursor)
virtual void insert (FormulaCursor *, TQPtrList< BasicElement > &, Direction)
virtual void remove (FormulaCursor *, TQPtrList< BasicElement > &, Direction)
virtual void normalize (FormulaCursor *, Direction)
virtual BasicElement * getChild (FormulaCursor *, Direction=beforeCursor)
virtual void selectChild (FormulaCursor *cursor, BasicElement *child)
virtual void childWillVanish (FormulaCursor *cursor, BasicElement *child)
uint countChildren () const
bool isChildNumber (uint pos, BasicElement *child)
void selectAllChildren (FormulaCursor *cursor)
bool onlyTextSelected (FormulaCursor *cursor)
virtual KCommand * buildCommand (Container *, Request *)
virtual KCommand * input (Container *container, TQChar ch)
virtual KCommand * input (Container *container, TQKeyEvent *event)
virtual void parse ()
void getChildrenDom (TQDomDocument &doc, TQDomElement elem, uint from, uint to)
void getChildrenMathMLDom (TQDomDocument &doc, TQDomNode &elem, uint from, uint to)
bool buildChildrenFromDom (TQPtrList< BasicElement > &list, TQDomNode n)
virtual TQString toLatex ()
virtual TQString formulaString ()
BasicElement * getChild (uint i)
const BasicElement * getChild (uint i) const
int childPos (BasicElement *child)
int childPos (const BasicElement *child) const
iterator begin ()
iterator end ()
virtual void setStyle (StyleElement *style)
virtual int buildChildrenFromMathMLDom (TQPtrList< BasicElement > &list, TQDomNode n)
virtual int readContentFromMathMLDom (TQDomNode &node)
int buildMathMLChild (TQDomNode node)
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 TQChar getCharacter () const
virtual TokenType getTokenType () const
virtual bool isInvisible () const
LuPixelPoint widgetPos ()
virtual void entered (SequenceElement *)
virtual SequenceElement * getMainChild ()
virtual bool isSenseless ()
virtual void registerTab (BasicElement *)
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)
virtual void writeMathML (TQDomDocument &doc, TQDomNode &parent, bool oasisFormat=false) const
bool buildFromDom (TQDomElement element)
int buildFromMathMLDom (TQDomElement element)
ElementType * getElementType () const
virtual void setElementType (ElementType *t)

Protected Member Functions

virtual bool readAttributesFromMathMLDom (const TQDomElement &element)
virtual void writeMathMLAttributes (TQDomElement &element) const
void setAbsoluteSize (double s, bool fontsize=false)
void setRelativeSize (double s, bool fontsize=false)
void setPixelSize (double s, bool fontsize=false)
void setCharStyle (CharStyle cs)
CharStyle charStyle () const
void setCharFamily (CharFamily cf)
CharFamily charFamily () const
void setMathColor (const TQColor &c)
TQColor mathColor () const
void setMathBackground (const TQColor &bg)
TQColor mathBackground () const
void setFontWeight (bool w)
bool fontWeight () const
void setFontStyle (bool s)
bool fontStyle () const
void setFontFamily (const TQString &s)
TQString fontFamily () const
void setColor (const TQColor &c)
TQColor color () const
bool customMathVariant () const
bool customMathColor () const
bool customMathBackground () const
bool customFontWeight () const
bool customFontStyle () const
bool customFontFamily () const
bool customColor () const
virtual void setStyleSize (const ContextStyle &context, StyleAttributes &style)
virtual void setStyleVariant (StyleAttributes &style)
void setStyleColor (StyleAttributes &style)
virtual void setStyleBackground (StyleAttributes &style)
virtual void resetStyle (StyleAttributes &style)
TQString getHtmlColor (const TQString &colorStr)
Protected Member Functions inherited from SequenceElement
virtual TQString getTagName () const
virtual void writeDom (TQDomElement element)
virtual TQString getElementName () const
virtual void writeMathMLContent (TQDomDocument &doc, TQDomElement &element, bool oasisFormat) const
virtual bool readAttributesFromDom (TQDomElement element)
virtual bool readContentFromDom (TQDomNode &node)
virtual void setChildrenPositions ()
virtual BasicElement * createElement (TQString type, const TQDomElement &element)
luPixel getChildPosition (const ContextStyle &context, uint child)
virtual bool isFirstOfToken (BasicElement *child)
bool insert (uint index, BasicElement *child)
virtual luPt getSpaceBefore (const ContextStyle &, ContextStyle::TextStyle, double)
virtual luPt getSpaceAfter (const ContextStyle &, ContextStyle::TextStyle, double)
Protected Member Functions inherited from BasicElement
bool buildChild (SequenceElement *child, TQDomNode node, TQString name)
double getSize (const TQString &str, SizeType *st)
SizeType getSpace (const TQString &str)

Additional Inherited Members

Public Types inherited from SequenceElement
typedef ChildIterator iterator
Static Public Member Functions inherited from SequenceElement
static void setCreationStrategy (ElementCreationStrategy *strategy)
Static Public Member Functions inherited from BasicElement
static int getEvilDestructionCount ()
Static Protected Member Functions inherited from SequenceElement
static ElementCreationStrategy * getCreationStrategy ()
Static Protected Attributes inherited from SequenceElement
static ElementCreationStrategy * creationStrategy = 0

Detailed Description

This class handles mathematical style attributes common to token elements, as explained in MathML Spec, Section 3.2.2.

It is in charge of reading and saving elements' attributes and setting rendering information according to these attributes.

Definition at line 35 of file tokenstyleelement.h.

Constructor & Destructor Documentation

◆ TokenStyleElement()

KFORMULA_NAMESPACE_BEGIN TokenStyleElement::TokenStyleElement ( BasicElement * parent = 0)

Definition at line 27 of file tokenstyleelement.cpp.

Member Function Documentation

◆ calcSizes()

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

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

Reimplemented from SequenceElement.

Definition at line 44 of file tokenstyleelement.cpp.

◆ charFamily()

CharFamily TokenStyleElement::charFamily ( ) const
inlineprotected

Definition at line 71 of file tokenstyleelement.h.

◆ charStyle()

CharStyle TokenStyleElement::charStyle ( ) const
inlineprotected

Definition at line 65 of file tokenstyleelement.h.

◆ color()

TQColor TokenStyleElement::color ( ) const
inlineprotected

Definition at line 107 of file tokenstyleelement.h.

◆ customColor()

bool TokenStyleElement::customColor ( ) const
inlineprotected

Definition at line 115 of file tokenstyleelement.h.

◆ customFontFamily()

bool TokenStyleElement::customFontFamily ( ) const
inlineprotected

Definition at line 114 of file tokenstyleelement.h.

◆ customFontStyle()

bool TokenStyleElement::customFontStyle ( ) const
inlineprotected

Definition at line 113 of file tokenstyleelement.h.

◆ customFontWeight()

bool TokenStyleElement::customFontWeight ( ) const
inlineprotected

Definition at line 112 of file tokenstyleelement.h.

◆ customMathBackground()

bool TokenStyleElement::customMathBackground ( ) const
inlineprotected

Definition at line 111 of file tokenstyleelement.h.

◆ customMathColor()

bool TokenStyleElement::customMathColor ( ) const
inlineprotected

Definition at line 110 of file tokenstyleelement.h.

◆ customMathVariant()

bool TokenStyleElement::customMathVariant ( ) const
inlineprotected

Definition at line 109 of file tokenstyleelement.h.

◆ draw()

void TokenStyleElement::draw ( TQPainter & painter,
const LuPixelRect & r,
const ContextStyle & context,
ContextStyle::TextStyle tstyle,
ContextStyle::IndexStyle istyle,
StyleAttributes & style,
const LuPixelPoint & parentOrigin )
virtual

Definition at line 57 of file tokenstyleelement.cpp.

◆ fontFamily()

TQString TokenStyleElement::fontFamily ( ) const
inlineprotected

Definition at line 101 of file tokenstyleelement.h.

◆ fontStyle()

bool TokenStyleElement::fontStyle ( ) const
inlineprotected

Definition at line 95 of file tokenstyleelement.h.

◆ fontWeight()

bool TokenStyleElement::fontWeight ( ) const
inlineprotected

Definition at line 89 of file tokenstyleelement.h.

◆ getHtmlColor()

TQString TokenStyleElement::getHtmlColor ( const TQString & colorStr)
protected

Return RGB string from HTML Colors.

See HTML Spec, section 6.5

Definition at line 583 of file tokenstyleelement.cpp.

◆ mathBackground()

TQColor TokenStyleElement::mathBackground ( ) const
inlineprotected

Definition at line 83 of file tokenstyleelement.h.

◆ mathColor()

TQColor TokenStyleElement::mathColor ( ) const
inlineprotected

Definition at line 77 of file tokenstyleelement.h.

◆ readAttributesFromMathMLDom()

bool TokenStyleElement::readAttributesFromMathMLDom ( const TQDomElement & element)
protectedvirtual

Reads our attributes from the MathML element.

Returns false if it failed.

Reimplemented from BasicElement.

Definition at line 79 of file tokenstyleelement.cpp.

◆ resetStyle()

void TokenStyleElement::resetStyle ( StyleAttributes & style)
protectedvirtual

Definition at line 539 of file tokenstyleelement.cpp.

◆ setAbsoluteSize()

void TokenStyleElement::setAbsoluteSize ( double s,
bool fontsize = false )
protected

Definition at line 406 of file tokenstyleelement.cpp.

◆ setCharFamily()

void TokenStyleElement::setCharFamily ( CharFamily cf)
inlineprotected

Definition at line 67 of file tokenstyleelement.h.

◆ setCharStyle()

void TokenStyleElement::setCharStyle ( CharStyle cs)
inlineprotected

Definition at line 61 of file tokenstyleelement.h.

◆ setColor()

void TokenStyleElement::setColor ( const TQColor & c)
inlineprotected

Definition at line 103 of file tokenstyleelement.h.

◆ setFontFamily()

void TokenStyleElement::setFontFamily ( const TQString & s)
inlineprotected

Definition at line 97 of file tokenstyleelement.h.

◆ setFontStyle()

void TokenStyleElement::setFontStyle ( bool s)
inlineprotected

Definition at line 91 of file tokenstyleelement.h.

◆ setFontWeight()

void TokenStyleElement::setFontWeight ( bool w)
inlineprotected

Definition at line 85 of file tokenstyleelement.h.

◆ setMathBackground()

void TokenStyleElement::setMathBackground ( const TQColor & bg)
inlineprotected

Definition at line 79 of file tokenstyleelement.h.

◆ setMathColor()

void TokenStyleElement::setMathColor ( const TQColor & c)
inlineprotected

Definition at line 73 of file tokenstyleelement.h.

◆ setPixelSize()

void TokenStyleElement::setPixelSize ( double s,
bool fontsize = false )
protected

Definition at line 432 of file tokenstyleelement.cpp.

◆ setRelativeSize()

void TokenStyleElement::setRelativeSize ( double s,
bool fontsize = false )
protected

Definition at line 419 of file tokenstyleelement.cpp.

◆ setStyleBackground()

void TokenStyleElement::setStyleBackground ( StyleAttributes & style)
protectedvirtual

Definition at line 529 of file tokenstyleelement.cpp.

◆ setStyleColor()

void TokenStyleElement::setStyleColor ( StyleAttributes & style)
protected

Definition at line 516 of file tokenstyleelement.cpp.

◆ setStyleSize()

void TokenStyleElement::setStyleSize ( const ContextStyle & context,
StyleAttributes & style )
protectedvirtual

Definition at line 445 of file tokenstyleelement.cpp.

◆ setStyleVariant()

void TokenStyleElement::setStyleVariant ( StyleAttributes & style)
protectedvirtual

Set the mathvariant related info in style stacks, including info for deprecated attributes.

It may be redefined by token elements whose behaviour differs from default one (e.g. identifiers)

Definition at line 450 of file tokenstyleelement.cpp.

◆ writeMathMLAttributes()

void TokenStyleElement::writeMathMLAttributes ( TQDomElement & element) const
protectedvirtual

Reimplemented from BasicElement.

Definition at line 263 of file tokenstyleelement.cpp.


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