22#include "bracketelement.h"
23#include "creationstrategy.h"
24#include "elementtype.h"
25#include "fractionelement.h"
26#include "identifierelement.h"
27#include "indexelement.h"
28#include "matrixelement.h"
29#include "operatorelement.h"
30#include "rootelement.h"
31#include "sequenceelement.h"
32#include "spaceelement.h"
33#include "symbolelement.h"
34#include "textelement.h"
35#include "numberelement.h"
37KFORMULA_NAMESPACE_BEGIN
39BasicElement* OrdinaryCreationStrategy::createElement( TQString type,
const TQDomElement& )
41 if ( type ==
"TEXT" )
return new TextElement();
42 else if ( type ==
"EMPTY" )
return new EmptyElement();
43 else if ( type ==
"SPACE" )
return new SpaceElement();
44 else if ( type ==
"ROOT" )
return new RootElement();
45 else if ( type ==
"BRACKET" )
return new BracketElement();
46 else if ( type ==
"MATRIX" )
return new MatrixElement();
47 else if ( type ==
"INDEX" )
return new IndexElement();
48 else if ( type ==
"FRACTION" )
return new FractionElement();
49 else if ( type ==
"SYMBOL" )
return new SymbolElement();
50 else if ( type ==
"NAMESEQUENCE" )
return new NameSequence();
51 else if ( type ==
"OVERLINE" )
return new OverlineElement();
52 else if ( type ==
"UNDERLINE" )
return new UnderlineElement();
53 else if ( type ==
"MULTILINE" )
return new MultilineElement();
54 else if ( type ==
"SEQUENCE" ) {
55 kdWarning() <<
"malformed data: sequence inside sequence." << endl;
67EmptyElement* OrdinaryCreationStrategy::createEmptyElement()
72NameSequence* OrdinaryCreationStrategy::createNameSequence()
74 return new NameSequence;
77BracketElement* OrdinaryCreationStrategy::createBracketElement( SymbolType lhs, SymbolType rhs )
79 return new BracketElement( lhs, rhs );
84 return new OverlineElement;
89 return new UnderlineElement;
94 return new MultilineElement;
97SpaceElement* OrdinaryCreationStrategy::createSpaceElement( SpaceWidth width )
99 return new SpaceElement( width );
104 return new FractionElement;
107RootElement* OrdinaryCreationStrategy::createRootElement()
109 return new RootElement;
112SymbolElement* OrdinaryCreationStrategy::createSymbolElement( SymbolType type )
114 return new SymbolElement( type );
122IndexElement* OrdinaryCreationStrategy::createIndexElement()
127IdentifierElement* OrdinaryCreationStrategy::createIdentifierElement()
129 return new IdentifierElement();
132OperatorElement* OrdinaryCreationStrategy::createOperatorElement()
134 return new OperatorElement();
137NumberElement* OrdinaryCreationStrategy::createNumberElement()
139 return new NumberElement();
144KFORMULA_NAMESPACE_END
Basis of every formula element.
A left and/or right bracket around one child.
An element that represents an empty box.
The element with up to four indexes in the four corners.
The sequence thats a name.
virtual MatrixElement * createMatrixElement(uint rows, uint columns)
when this gets called the user has seen the matrix dialog and expects a matrix!
virtual TextElement * createTextElement(const TQChar &ch, bool symbol=false)
there must always be a TextElement, so this can never return 0
A line above the content.
A element that represents a space.
A symbol is simply a piece of art.
An element that represents one char.
A line below the content.