20#include "textelement.h"
21#include "stringelement.h"
23KFORMULA_NAMESPACE_BEGIN
25StringElement::StringElement(
BasicElement* parent ) : TokenElement( parent )
29bool StringElement::readAttributesFromMathMLDom(
const TQDomElement& element)
35 if ( ! inherited::readAttributesFromMathMLDom( 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 );
57 child->setParent(
this );
58 child->setCharFamily( charFamily() );
59 child->setCharStyle( charStyle() );
62 child->setParent(
this );
63 child->setCharFamily( charFamily() );
64 child->setCharStyle( charStyle() );
65 insert( countChildren(), child );
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
82 for ( uint i = 1; i < countChildren() - 1; ++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.
An element that represents one char.