4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
16 #include "support/std_string.h"
22 /// Standard Sizes (mode styles)
36 // This is the part common to MetricsInfo and PainterInfo
42 MetricsBase(BufferView * bv, LyXFont const & font, int textwidth);
48 /// current math style (display/text/script/..)
50 /// name of current font - mathed specific
52 /// This is the width available in pixels
58 // This contains a Metricsbase and Information that's only relevant during
59 // the first phase of the two-phase draw
65 MetricsInfo(BufferView * bv, LyXFont const & font, int textwidth);
73 // This contains a Metricsbase and Information that's only relevant during
74 // the second phase of the two-phase draw
78 explicit PainterInfo(BufferView * bv);
80 void draw(int x, int y, char c);
86 /// width of current item
91 struct TextMetricsInfo {};
94 // Generic base for temporarily changing things.
95 // The original state gets restored when the Changer is destructed.
97 template <class Struct, class Temp = Struct>
100 Changer(Struct & orig) : orig_(orig) {}
110 // temporarily change some aspect of a font
111 struct FontChanger : public Changer<LyXFont> {
113 FontChanger(LyXFont & orig, char const * font);
119 // temporarily change a full font
120 struct FontSetChanger : public Changer<MetricsBase> {
122 FontSetChanger(MetricsBase & mb, char const * font);
128 // temporarily change the style
129 struct StyleChanger : public Changer<MetricsBase> {
131 StyleChanger(MetricsBase & mb, Styles style);
137 // temporarily change the style to script style
138 struct ScriptChanger : public StyleChanger {
140 ScriptChanger(MetricsBase & mb);
144 // temporarily change the style suitable for use in fractions
145 struct FracChanger : public StyleChanger {
147 FracChanger(MetricsBase & mb);
151 // temporarily change the style suitable for use in tabulars and arrays
152 struct ArrayChanger : public StyleChanger {
154 ArrayChanger(MetricsBase & mb);
159 // temporarily change the shape of a font
160 struct ShapeChanger : public Changer<LyXFont, LyXFont::FONT_SHAPE> {
162 ShapeChanger(LyXFont & font, LyXFont::FONT_SHAPE shape);
168 // temporarily change the available text width
169 struct WidthChanger : public Changer<MetricsBase>
172 WidthChanger(MetricsBase & mb, int width);