]> git.lyx.org Git - lyx.git/blob - src/mathed/math_fontinset.h
Andreas' patch to prevent crash on click on previewd inset
[lyx.git] / src / mathed / math_fontinset.h
1 // -*- C++ -*-
2 /**
3  * \file math_fontinset.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_FONTINSET_H
13 #define MATH_FONTINSET_H
14
15 #include "math_nestinset.h"
16
17
18 class latexkeys;
19
20 /// Inset for font changes
21 class MathFontInset : public MathNestInset {
22 public:
23         ///
24         explicit MathFontInset(latexkeys const * key);
25         ///
26         MathFontInset * asFontInset() { return this; }
27         ///
28         MathFontInset const * asFontInset() const { return this; }
29         /// are we in math mode, text mode, or unsure?
30         mode_type currentMode() const;
31         ///
32         std::string name() const;
33         ///
34         void metrics(MetricsInfo & mi, Dimension & dim) const;
35         ///
36         void draw(PainterInfo & pi, int x, int y) const;
37         ///
38         void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
39         ///
40         void drawT(TextPainter & pi, int x, int y) const;
41         ///
42         void validate(LaTeXFeatures & features) const;
43         ///
44         void infoize(std::ostream & os) const;
45
46 private:
47         virtual std::auto_ptr<InsetBase> doClone() const;
48         /// the font to be used on screen
49         latexkeys const * key_;
50 };
51 #endif