#ifndef MATH_METRICSINFO_H #define MATH_METRICSINFO_H #include "lyxfont.h" #include "LString.h" class BufferView; class Painter; class MathNestInset; /// Standard Math Sizes (Math mode styles) enum MathStyles { /// LM_ST_DISPLAY = 0, /// LM_ST_TEXT, /// LM_ST_SCRIPT, /// LM_ST_SCRIPTSCRIPT }; struct MathMetricsBase { /// MathMetricsBase(); /// LyXFont font; /// MathStyles style; /// string fontname; /// if this is set... bool restrictwidth; /// ... this is valid int textwidth; }; struct MathMetricsInfo { /// MathMetricsInfo(); /// MathMetricsBase base; /// BufferView * view; /// bool fullredraw; }; struct MathPainterInfo { /// MathPainterInfo(Painter & p); /// void draw(int x, int y, char c); /// MathMetricsBase base; /// Painter & pain; }; struct TextMetricsInfo {}; // Generic base for temporarily changing things. // The original state gets restored when the Changer is destructed template struct MathChanger { /// MathChanger(Struct & orig) : orig_(orig) {} protected: /// Struct & orig_; /// Temp save_; }; struct MathScriptChanger : public MathChanger { /// MathScriptChanger(MathMetricsBase & orig); /// ~MathScriptChanger(); }; struct MathFracChanger : public MathChanger { /// MathFracChanger(MathMetricsBase & orig); /// ~MathFracChanger(); }; struct MathFontChanger : public MathChanger { /// MathFontChanger(LyXFont & orig, char const * font); /// ~MathFontChanger(); }; struct MathFontSetChanger : public MathChanger { /// MathFontSetChanger(MathMetricsBase & mb, char const * font); /// ~MathFontSetChanger(); }; struct MathStyleChanger : public MathChanger { /// MathStyleChanger(MathMetricsBase & mb, MathStyles shape); /// ~MathStyleChanger(); }; struct MathShapeChanger : public MathChanger { /// MathShapeChanger(LyXFont & font, LyXFont::FONT_SHAPE shape); /// ~MathShapeChanger(); }; struct MathWidthChanger : public MathChanger { /// MathWidthChanger(MathMetricsBase & mb, int width); /// ~MathWidthChanger(); }; #endif