lib
styleelement.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef STYLEELEMENT_H
00021 #define STYLEELEMENT_H
00022
00023 #include "kformuladefs.h"
00024 #include "tokenstyleelement.h"
00025
00026 KFORMULA_NAMESPACE_BEGIN
00027
00028 class StyleElement : public TokenStyleElement {
00029 typedef TokenStyleElement inherited;
00030 public:
00031
00032 StyleElement( BasicElement* parent = 0 );
00033
00034 protected:
00035
00036 virtual bool readAttributesFromMathMLDom( const QDomElement &element );
00037
00038 virtual void setStyleSize( const ContextStyle& context, StyleAttributes& style );
00039 virtual void setStyleVariant( StyleAttributes& style );
00040 virtual void setStyleBackground( StyleAttributes& style );
00041 virtual void resetStyle( StyleAttributes& style );
00042
00043 private:
00044 virtual QString getElementName() const { return "mstyle"; }
00045 virtual void writeMathMLAttributes( QDomElement& element ) const ;
00046
00047 void readSizeAttribute( const QString& str, SizeType* st, double* s );
00048 void writeSizeAttribute( QDomElement element, const QString& str, SizeType st, double s ) const ;
00049
00050 double sizeFactor( const ContextStyle& context, SizeType st, double length, double defvalue );
00051
00052 int m_scriptLevel;
00053 SizeType m_scriptMinSizeType;
00054 double m_scriptSizeMultiplier;
00055 double m_scriptMinSize;
00056 QColor m_background;
00057 SizeType m_veryVeryThinMathSpaceType;
00058 double m_veryVeryThinMathSpace;
00059 SizeType m_veryThinMathSpaceType;
00060 double m_veryThinMathSpace;
00061 SizeType m_thinMathSpaceType;
00062 double m_thinMathSpace;
00063 SizeType m_mediumMathSpaceType;
00064 double m_mediumMathSpace;
00065 SizeType m_thickMathSpaceType;
00066 double m_thickMathSpace;
00067 SizeType m_veryThickMathSpaceType;
00068 double m_veryThickMathSpace;
00069 SizeType m_veryVeryThickMathSpaceType;
00070 double m_veryVeryThickMathSpace;
00071 bool m_displayStyle;
00072 bool m_customScriptLevel;
00073 bool m_relativeScriptLevel;
00074 bool m_customDisplayStyle;
00075 bool m_customScriptSizeMultiplier;
00076 bool m_customBackground;
00077 };
00078
00079 KFORMULA_NAMESPACE_END
00080
00081 #endif // TOKENSTYLEELEMENT_H
|