27#include "basicelement.h"
32KFORMULA_NAMESPACE_BEGIN
37class TextElement :
public BasicElement {
38 TextElement operator=(
const TextElement& ) {
return *
this; }
41 TextElement(TQChar ch =
' ',
bool beSymbol =
false, BasicElement* parent = 0);
42 TextElement(
const TextElement& );
44 virtual TextElement* clone() {
45 return new TextElement( *
this );
80 ContextStyle::IndexStyle istyle,
81 StyleAttributes& style );
88 virtual void draw( TQPainter& painter,
const LuPixelRect& r,
91 ContextStyle::IndexStyle istyle,
92 StyleAttributes& style,
93 const LuPixelPoint& parentOrigin );
105 CharStyle getCharStyle()
const {
return charStyle(); }
106 void setCharStyle( CharStyle cs );
108 CharFamily getCharFamily()
const {
return charFamily(); }
109 void setCharFamily( CharFamily cf );
111 char format()
const {
return m_format; }
130 virtual TQString formulaString();
132 virtual void writeMathML( TQDomDocument& doc, TQDomNode& parent,
bool oasisFormat =
false )
const ;
146 virtual void writeDom(TQDomElement element);
200 CharStyle charStyle()
const {
return static_cast<CharStyle
>( m_format & 0x0f ); }
201 void charStyle( CharStyle cs )
202 { m_format = ( m_format & 0xf0 ) |
static_cast<char>( cs ); }
209 CharFamily charFamily()
const
210 {
return static_cast<CharFamily
>( m_format >> 4 ); }
211 void charFamily( CharFamily cf )
212 { m_format = ( m_format & 0x0f ) | (
static_cast<char>( cf ) << 4 ); }
225class EmptyElement :
public BasicElement {
226 EmptyElement& operator=(
const EmptyElement& ) {
return *
this; }
229 EmptyElement( BasicElement* parent = 0 );
230 EmptyElement(
const EmptyElement& );
232 virtual EmptyElement* clone() {
233 return new EmptyElement( *
this );
251 ContextStyle::IndexStyle istyle,
252 StyleAttributes& style );
259 virtual void draw( TQPainter& painter,
const LuPixelRect& r,
262 ContextStyle::IndexStyle istyle,
263 StyleAttributes& style,
264 const LuPixelPoint& parentOrigin );
285KFORMULA_NAMESPACE_END
Contains all the style information for the formela.
TextStyle
Textstyles like in TeX.
virtual void calcSizes(const ContextStyle &cstyle, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes &style)
Calculates our width and height and our children's parentPosition.
virtual TQChar getCharacter() const
virtual TQString getTagName() const
virtual bool accept(ElementVisitor *visitor)
Visit this element.
virtual TQString toLatex()
Draws the whole element including its children.
Base for all font commands that act on the current selection.
virtual void dispatchFontCommand(FontCommand *cmd)
Draws the whole element including its children.
void setUpPainter(const ContextStyle &context, TQPainter &painter)
Sets up the painter to be used for drawing.
virtual bool isInvisible() const
virtual void writeMathML(TQDomDocument &doc, TQDomNode &parent, bool oasisFormat=false) const
Same as above, just MathML.
virtual TQString toLatex()
virtual bool accept(ElementVisitor *visitor)
Visit this element.
virtual TQChar getCharacter() const
TQChar getRealCharacter(const ContextStyle &context)
bool isSymbol() const
Moves the cursor away from the given child.
virtual void writeDom(TQDomElement element)
Appends our attributes to the dom element.
virtual TokenType getTokenType() const
void setColor(TQColor c)
Set the color to use to display.
virtual void calcSizes(const ContextStyle &cstyle, ContextStyle::TextStyle tstyle, ContextStyle::IndexStyle istyle, StyleAttributes &style)
Calculates our width and height and our children's parentPosition.
virtual bool readAttributesFromDom(TQDomElement element)
Reads our attributes from the element.
virtual TQString getTagName() const
virtual bool readContentFromDom(TQDomNode &node)
Reads our content from the node.
TQFont getFont(const ContextStyle &context, const StyleAttributes &style)