lib
spaceelement.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef SPACEELEMENT_H
00023 #define SPACEELEMENT_H
00024
00025 #include <qfont.h>
00026 #include <qstring.h>
00027
00028 #include "basicelement.h"
00029
00030 class SymbolTable;
00031
00032
00033 KFORMULA_NAMESPACE_BEGIN
00034
00038 class SpaceElement : public BasicElement {
00039 enum LineBreakType {
00040 NoBreakType,
00041 AutoBreak,
00042 NewLineBreak,
00043 IndentingNewLineBreak,
00044 NoBreak,
00045 GoodBreak,
00046 BadBreak
00047 };
00048 SpaceElement operator=( const SpaceElement& ) { return *this; }
00049 public:
00050
00051 SpaceElement( SpaceWidth space = THIN, bool tab=false, BasicElement* parent = 0 );
00052 SpaceElement( const SpaceElement& );
00053
00054 virtual SpaceElement* clone() {
00055 return new SpaceElement( *this );
00056 }
00057
00058 virtual bool accept( ElementVisitor* visitor );
00059
00064
00065
00070 virtual QChar getCharacter() const { return ' '; }
00071
00072
00073
00074
00075
00076
00077
00078
00083 virtual void calcSizes( const ContextStyle& style,
00084 ContextStyle::TextStyle tstyle,
00085 ContextStyle::IndexStyle istyle,
00086 StyleAttributes& style );
00087
00093 virtual void draw( QPainter& painter, const LuPixelRect& r,
00094 const ContextStyle& context,
00095 ContextStyle::TextStyle tstyle,
00096 ContextStyle::IndexStyle istyle,
00097 StyleAttributes& style,
00098 const LuPixelPoint& parentOrigin );
00099
00104
00105
00110 virtual QString toLatex();
00111
00112 protected:
00113
00114
00115
00119 virtual QString getTagName() const { return "SPACE"; }
00120
00124 virtual void writeDom(QDomElement element);
00125
00130 virtual bool readAttributesFromDom(QDomElement element);
00131
00137 virtual bool readContentFromDom(QDomNode& node);
00138
00143 virtual bool readAttributesFromMathMLDom(const QDomElement& element);
00144
00145 private:
00146
00147 virtual QString getElementName() const { return "mspace"; }
00148 virtual void writeMathMLAttributes( QDomElement& element ) const ;
00149
00153 bool m_tab;
00154
00155
00156 SizeType m_widthType;
00157 double m_width;
00158 SizeType m_heightType;
00159 double m_height;
00160 SizeType m_depthType;
00161 double m_depth;
00162 LineBreakType m_lineBreak;
00163 };
00164
00165 KFORMULA_NAMESPACE_END
00166
00167 #endif // SPACEELEMENT_H
|