]> git.lyx.org Git - lyx.git/blob - src/mathed/math_fontoldinset.h
Andreas' patch to prevent crash on click on previewd inset
[lyx.git] / src / mathed / math_fontoldinset.h
1 // -*- C++ -*-
2 /**
3  * \file math_fontoldinset.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author André Pönitz
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef MATH_FONTOLDINSET_H
13 #define MATH_FONTOLDINSET_H
14
15 #include "math_nestinset.h"
16
17
18 class latexkeys;
19
20 /// Old-style font changes
21 class MathFontOldInset : public MathNestInset {
22 public:
23         ///
24         explicit MathFontOldInset(latexkeys const * key);
25         /// we are in text mode.
26         mode_type currentMode() const { return TEXT_MODE; }
27         /// we write extra braces in any case...
28         bool extraBraces() const { return true; }
29         ///
30         void metrics(MetricsInfo & mi, Dimension & dim) const;
31         ///
32         void draw(PainterInfo & pi, int x, int y) const;
33         ///
34         void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
35         ///
36         void drawT(TextPainter & pi, int x, int y) const;
37         ///
38         void write(WriteStream & os) const;
39         ///
40         void normalize(NormalStream &) const;
41         ///
42         void infoize(std::ostream & os) const;
43
44 private:
45         virtual std::auto_ptr<InsetBase> doClone() const;
46         /// the font to be used on screen
47         latexkeys const * key_;
48 };
49 #endif