]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathFont.h
Fix CSS
[lyx.git] / src / mathed / InsetMathFont.h
1 // -*- C++ -*-
2 /**
3  * \file InsetMathFont.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 "InsetMathNest.h"
16
17
18 namespace lyx {
19
20
21 class latexkeys;
22
23 /// Inset for font changes
24 class InsetMathFont : public InsetMathNest {
25 public:
26         ///
27         explicit InsetMathFont(Buffer * buf, latexkeys const * key);
28         ///
29         InsetMathFont * asFontInset() override { return this; }
30         ///
31         InsetMathFont const * asFontInset() const override { return this; }
32         /// are we in math mode, text mode, or unsure?
33         mode_type currentMode() const override;
34         /// do we allow changing mode during latex export?
35         bool lockedMode() const override;
36         ///
37         void write(TeXMathStream & os) const override;
38         ///
39         docstring name() const override;
40         ///
41         void metrics(MetricsInfo & mi, Dimension & dim) const override;
42         ///
43         void draw(PainterInfo & pi, int x, int y) const override;
44         ///
45         void metricsT(TextMetricsInfo const & mi, Dimension & dim) const override;
46         ///
47         void drawT(TextPainter & pi, int x, int y) const override;
48         ///
49         void validate(LaTeXFeatures & features) const override;
50         ///
51         void mathmlize(MathMLStream &) const override;
52         ///
53         void htmlize(HtmlStream &) const override;
54         ///
55         void infoize(odocstream & os) const override;
56         ///
57         int kerning(BufferView const * bv) const override { return cell(0).kerning(bv); }
58         ///
59         InsetCode lyxCode() const override { return MATH_FONT_CODE; }
60
61 private:
62         std::string font() const;
63         ///
64         Inset * clone() const override;
65         /// the font to be used on screen
66         latexkeys const * key_;
67 };
68
69
70 } // namespace lyx
71 #endif