00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef SPACEELEMENT_H
00024 #define SPACEELEMENT_H
00025
00026 #include "BasicElement.h"
00027
00028 namespace KFormula {
00029
00033 class SpaceElement : public BasicElement {
00034 enum LineBreakType {
00035 NoBreakType,
00036 AutoBreak,
00037 NewLineBreak,
00038 IndentingNewLineBreak,
00039 NoBreak,
00040 GoodBreak,
00041 BadBreak
00042 };
00043 public:
00045 SpaceElement( BasicElement* parent = 0 );
00046
00052 virtual void calcSizes( const ContextStyle& style,
00053 ContextStyle::TextStyle tstyle,
00054 ContextStyle::IndexStyle istyle,
00055 StyleAttributes& style );
00056
00063 virtual void draw( QPainter& painter, const LuPixelRect& r,
00064 const ContextStyle& context,
00065 ContextStyle::TextStyle tstyle,
00066 ContextStyle::IndexStyle istyle,
00067 StyleAttributes& style,
00068 const LuPixelPoint& parentOrigin );
00069
00074 void paint( QPainter& painter ) const;
00075
00077 void calculateSize();
00078
00080 void readMathML( const QDomElement& element );
00081
00083 void writeMathML( KoXmlWriter* writer, bool oasisFormat = false );
00084
00085 protected:
00089 virtual QString getTagName() const { return "SPACE"; }
00090
00094 virtual void writeDom(QDomElement element);
00095
00100 virtual bool readAttributesFromDom(QDomElement element);
00101
00107 virtual bool readContentFromDom(QDomNode& node);
00112 virtual bool readAttributesFromMathMLDom(const QDomElement& element);
00113
00114 private:
00115
00116 virtual QString getElementName() const { return "mspace"; }
00117 virtual void writeMathMLAttributes( QDomElement& element ) const ;
00118
00122 bool m_tab;
00123
00124
00125 SizeType m_widthType;
00126 double m_width;
00127 SizeType m_heightType;
00128 double m_height;
00129 SizeType m_depthType;
00130 double m_depth;
00131 LineBreakType m_lineBreak;
00132 };
00133
00134 }
00135
00136 #endif // SPACEELEMENT_H