28#include "contextstyle.h"
29#include "kformuladefs.h"
33KFORMULA_NAMESPACE_BEGIN
37class ComplexElementType;
38class InnerElementType;
55 virtual ~ElementType();
71 uint start() const { return from; }
76 uint end() const { return to; }
89 virtual luPt getSpaceAfter( OperatorType* type,
93 virtual luPt getSpaceAfter( RelationType* type,
97 virtual luPt getSpaceAfter( PunctuationType* type,
101 virtual luPt getSpaceAfter( BracketType* type,
105 virtual luPt getSpaceAfter( ComplexElementType* type,
109 virtual luPt getSpaceAfter( InnerElementType* type,
125 static int getEvilDestructionCount() { return evilDestructionCount; }
127 virtual void output();
132 void append( ElementType* );
134 ElementType* getPrev() const { return prev; }
136 virtual void saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat = false );
138 virtual bool multiElement() const { return false; }
143 void setEnd( uint end ) { to = end; }
145 luPt thinSpaceIfNotScript( const ContextStyle& context,
148 luPt mediumSpaceIfNotScript( const ContextStyle& context,
151 luPt thickSpaceIfNotScript( const ContextStyle& context,
176 static int evilDestructionCount;
184class SequenceType : public ElementType {
189 virtual void output();
202class MultiElementType : public ElementType {
209 virtual luPt getSpaceAfter( OperatorType* type,
213 virtual luPt getSpaceAfter( RelationType* type,
217 virtual luPt getSpaceAfter( InnerElementType* type,
222 virtual bool multiElement() const { return true; }
240class TextType : public MultiElementType {
243 virtual void saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat = false );
250class NumberType : public MultiElementType {
264 virtual void saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat = false );
271class SingleElementType : public ElementType {
280class NameType : public MultiElementType {
289 virtual void saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat = false );
299 void saveMathML( SequenceElement* se, TQDomDocument& doc, TQDomElement de, bool oasisFormat = false );
302class OperatorType : public AbstractOperatorType {
304 OperatorType( SequenceParser* parser );
306 virtual luPt getSpaceBefore( const ContextStyle& context,
309 virtual luPt getSpaceAfter( MultiElementType* type,
310 const ContextStyle& context,
313 virtual luPt getSpaceAfter( BracketType* type,
314 const ContextStyle& context,
317 virtual luPt getSpaceAfter( ComplexElementType* type,
318 const ContextStyle& context,
321 virtual luPt getSpaceAfter( InnerElementType* type,
322 const ContextStyle& context,
329 virtual TQFont getFont( const ContextStyle& context);
334 virtual void setUpPainter( const ContextStyle& context, TQPainter& painter);
338class RelationType : public AbstractOperatorType {
340 RelationType( SequenceParser* parser );
342 virtual luPt getSpaceBefore( const ContextStyle& context,
345 virtual luPt getSpaceAfter( MultiElementType* type,
346 const ContextStyle& context,
349 virtual luPt getSpaceAfter( BracketType* type,
350 const ContextStyle& context,
353 virtual luPt getSpaceAfter( ComplexElementType* type,
354 const ContextStyle& context,
357 virtual luPt getSpaceAfter( InnerElementType* type,
358 const ContextStyle& context,
365 virtual TQFont getFont( const ContextStyle& context );
370 virtual void setUpPainter( const ContextStyle& context, TQPainter& painter );
374class PunctuationType : public AbstractOperatorType {
376 PunctuationType( SequenceParser* parser );
378 virtual luPt getSpaceBefore( const ContextStyle& context,
381 virtual luPt getSpaceAfter( MultiElementType* type,
382 const ContextStyle& context,
385 virtual luPt getSpaceAfter( RelationType* type,
386 const ContextStyle& context,
389 virtual luPt getSpaceAfter( PunctuationType* type,
390 const ContextStyle& context,
393 virtual luPt getSpaceAfter( BracketType* type,
394 const ContextStyle& context,
397 virtual luPt getSpaceAfter( ComplexElementType* type,
398 const ContextStyle& context,
401 virtual luPt getSpaceAfter( InnerElementType* type,
402 const ContextStyle& context,
409 virtual TQFont getFont( const ContextStyle& context );
414 virtual void setUpPainter( const ContextStyle& context, TQPainter& painter );
420 BracketType( SequenceParser* parser );
422 virtual luPt getSpaceBefore( const ContextStyle& context,
425 virtual luPt getSpaceAfter( OperatorType* type,
426 const ContextStyle& context,
429 virtual luPt getSpaceAfter( RelationType* type,
430 const ContextStyle& context,
433 virtual luPt getSpaceAfter( InnerElementType* type,
434 const ContextStyle& context,
442 ComplexElementType( SequenceParser* parser );
445 virtual luPt getSpaceBefore( const ContextStyle& context,
448 virtual luPt getSpaceAfter( OperatorType* type,
449 const ContextStyle& context,
452 virtual luPt getSpaceAfter( RelationType* type,
453 const ContextStyle& context,
456 virtual luPt getSpaceAfter( InnerElementType* type,
457 const ContextStyle& context,
465 InnerElementType( SequenceParser* parser );
467 virtual luPt getSpaceBefore( const ContextStyle& context,
470 virtual luPt getSpaceAfter( MultiElementType* type,
471 const ContextStyle& context,
474 virtual luPt getSpaceAfter( OperatorType* type,
475 const ContextStyle& context,
478 virtual luPt getSpaceAfter( RelationType* type,
479 const ContextStyle& context,
482 virtual luPt getSpaceAfter( PunctuationType* type,
483 const ContextStyle& context,
486 virtual luPt getSpaceAfter( BracketType* type,
487 const ContextStyle& context,
490 virtual luPt getSpaceAfter( ComplexElementType* type,
491 const ContextStyle& context,
494 virtual luPt getSpaceAfter( InnerElementType* type,
495 const ContextStyle& context,
501KFORMULA_NAMESPACE_END
Basis of every formula element.
Contains all the style information for the formela.
TextStyle Textstyles like in TeX.
virtual TQFont getFont(const ContextStyle &context)
virtual TQString text(SequenceElement *seq) const
virtual bool isInvisible(const TextElement &) const
void append(ElementType *) Adds a type at the end of the list.
virtual luPt getSpaceBefore(const ContextStyle &context, ContextStyle::TextStyle tstyle, double factor)
virtual void setUpPainter(const ContextStyle &context, TQPainter &painter) sets the painters pen to a appropriate value
Basis for all tokens that run along several elements.
virtual luPt getSpaceBefore(const ContextStyle &context, ContextStyle::TextStyle tstyle, double factor)
virtual TQString text(SequenceElement *) const
virtual TQFont getFont(const ContextStyle &context)
virtual void setUpPainter(const ContextStyle &context, TQPainter &painter) sets the painters pen to a appropriate value
virtual TQFont getFont(const ContextStyle &context)
The element that contains a number of children.
The parser that gets the element list and returns a syntax tree.
Basis for all tokens that consist of one element only.
An element that represents one char.
|