20#include "textelement.h"
21#include "stringelement.h"
23KFORMULA_NAMESPACE_BEGIN
25StringElement::StringElement(
BasicElement* parent ) : TokenElement( parent )
29bool StringElement::readAttributesFromMathMLDom(
const TQDomElement& element)
39 m_lquote = element.attribute(
"lquote" );
40 if ( ! m_lquote.isNull() ) {
41 m_customLquote =
true;
43 m_rquote = element.attribute(
"rquote" );
44 if ( ! m_rquote.isNull() ) {
45 m_customRquote =
true;
51int StringElement::buildChildrenFromMathMLDom(TQPtrList<BasicElement>& list, TQDomNode n)
53 int count = inherited::buildChildrenFromMathMLDom( list, n );
56 TextElement* child =
new TextElement(
'"' );
57 child->setParent(
this );
58 child->setCharFamily( charFamily() );
59 child->setCharStyle( charStyle() );
61 child =
new TextElement(
'"' );
62 child->setParent(
this );
63 child->setCharFamily( charFamily() );
64 child->setCharStyle( charStyle() );
69void StringElement::writeMathMLAttributes( TQDomElement& element )
const
71 inherited::writeMathMLAttributes( element );
72 if ( m_customLquote ) {
73 element.setAttribute(
"lquote", m_lquote );
75 if ( m_customRquote ) {
76 element.setAttribute(
"rquote", m_rquote );
80void StringElement::writeMathMLContent( TQDomDocument& doc, TQDomElement& element,
bool oasisFormat )
const
83 const BasicElement* e =
getChild( i );
Basis of every formula element.
virtual bool readAttributesFromMathMLDom(const TQDomElement &element)
Reads our attributes from the MathML element.
virtual void writeMathML(TQDomDocument &doc, TQDomNode &parent, bool oasisFormat=false) const
Same as above, just MathML.
uint countChildren() const
virtual BasicElement * getChild(FormulaCursor *, Direction=beforeCursor)
Returns the child at the cursor.
virtual void insert(FormulaCursor *, TQPtrList< BasicElement > &, Direction)
Inserts all new children at the cursor position.