]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathChar.h
Cmake build: Adapt to compile after 0213e7b5c62f487bdddd95ff0b2de736f64b1dc3
[lyx.git] / src / mathed / InsetMathChar.h
1 // -*- C++ -*-
2 /**
3  * \file InsetMathChar.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_CHARINSET_H
13 #define MATH_CHARINSET_H
14
15 #include "InsetMath.h"
16
17 namespace lyx {
18
19 /// The base character inset.
20 class InsetMathChar : public InsetMath {
21 public:
22         ///
23         explicit InsetMathChar(char_type c);
24         ///
25         void metrics(MetricsInfo & mi, Dimension & dim) const;
26         ///
27         void draw(PainterInfo & pi, int x, int y) const;
28         ///
29         void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
30         ///
31         void drawT(TextPainter &, int x, int y) const;
32         ///
33         int kerning(BufferView const *) const { return kerning_; }
34
35         ///
36         void write(WriteStream & os) const;
37         ///
38         void validate(LaTeXFeatures & features) const;
39         ///
40         void normalize(NormalStream & ns) const;
41         ///
42         void octave(OctaveStream & os) const;
43         ///
44         void mathmlize(MathStream & ms) const;
45         ///
46         void htmlize(HtmlStream & ms) const;
47         /// identifies Charinsets
48         InsetMathChar const * asCharInset() const { return this; }
49         ///
50         char_type getChar() const { return char_; }
51         ///
52         bool isRelOp() const;
53         ///
54         InsetCode lyxCode() const { return MATH_CHAR_CODE; }
55
56 private:
57         virtual Inset * clone() const;
58         /// the character
59         char_type char_;
60         /// cached kerning for superscript
61         mutable int kerning_;
62 };
63
64 } // namespace lyx
65
66 #endif