]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathSpecialChar.h
Fix bug 5802 (http://bugzilla.lyx.org/show_bug.cgi?id=5802)
[lyx.git] / src / mathed / InsetMathSpecialChar.h
1 // -*- C++ -*-
2 /**
3  * \file InsetMathSpecialChar.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Enrico Forestieri
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef MATH_SPECIALCHARINSET_H
13 #define MATH_SPECIALCHARINSET_H
14
15 #include "InsetMath.h"
16
17 namespace lyx {
18
19 /// The special character inset.
20 class InsetMathSpecialChar : public InsetMath
21 {
22 public:
23         ///
24         explicit InsetMathSpecialChar(docstring const & name);
25         ///
26         void setBuffer(Buffer &) {}
27         ///
28         void metrics(MetricsInfo & mi, Dimension & dim) const;
29         ///
30         void draw(PainterInfo & pi, int x, int y) const;
31         ///
32         void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
33         ///
34         void drawT(TextPainter &, int x, int y) const;
35         ///
36         int kerning(BufferView const *) const { return kerning_; }
37         ///
38         void write(WriteStream & os) const;
39         ///
40         void validate(LaTeXFeatures & features) const;
41         ///
42         void normalize(NormalStream & ns) const;
43         ///
44         void octave(OctaveStream & os) const;
45         ///
46         void maple(MapleStream &) const;
47         ///
48         void mathematica(MathematicaStream &) const;
49         ///
50         void mathmlize(MathStream & ms) const;
51         /// identifies SpecialChar insets
52         InsetMathSpecialChar const * asSpecialCharInset() const { return this; }
53         ///
54         docstring name() const { return name_; }
55         ///
56         char_type getChar() const { return char_; }
57
58 private:
59         virtual Inset * clone() const;
60         /// the latex name
61         docstring name_;
62         /// the displayed character
63         char_type char_;
64         /// cached kerning for superscript
65         mutable int kerning_;
66 };
67
68 } // namespace lyx
69
70 #endif // MATH_SPECIALCHARINSET_H