]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathChar.h
c1d5b1974a1608927410608c1795d1e0cb847bc7
[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 #include "Font.h"
18
19 namespace lyx {
20
21 /// The base character inset.
22 class InsetMathChar : public InsetMath {
23 public:
24         ///
25         explicit InsetMathChar(char_type c);
26         ///
27         void metrics(MetricsInfo & mi, Dimension & dim) const;
28         ///
29         Dimension const dimension(BufferView const &) const { return dim_; }
30         ///
31         void draw(PainterInfo & pi, int x, int y) const;
32         ///
33         void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
34         ///
35         void drawT(TextPainter &, int x, int y) const;
36         ///
37         int kerning() const { return kerning_; }
38
39         ///
40         void write(WriteStream & os) const;
41         ///
42         void normalize(NormalStream & ns) const;
43         ///
44         void octave(OctaveStream & os) const;
45         ///
46         void mathmlize(MathStream & 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 private:
55         virtual Inset * clone() const;
56         /// the character
57         char_type char_;
58         /// cached kerning for superscript
59         mutable int kerning_;
60         /// FIXME: move this out to BufferView
61         mutable Dimension dim_;
62 };
63
64 } // namespace lyx
65
66 #endif