Give inset codes to all the math insets, so we get more information when
[lyx.git] / src / mathed / InsetMathSpecialChar.h
blobc672b504f688045bce4ba1acabf181f25f7ad756
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.
7 * \author Enrico Forestieri
9 * Full author contact details are available in file CREDITS.
12 #ifndef MATH_SPECIALCHARINSET_H
13 #define MATH_SPECIALCHARINSET_H
15 #include "InsetMath.h"
17 namespace lyx {
19 /// The special character inset.
20 class InsetMathSpecialChar : public InsetMath
22 public:
23 ///
24 explicit InsetMathSpecialChar(docstring const & name);
25 ///
26 void metrics(MetricsInfo & mi, Dimension & dim) const;
27 ///
28 void draw(PainterInfo & pi, int x, int y) const;
29 ///
30 void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
31 ///
32 void drawT(TextPainter &, int x, int y) const;
33 ///
34 int kerning(BufferView const *) const { return kerning_; }
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 maple(MapleStream &) const;
45 ///
46 void mathematica(MathematicaStream &) const;
47 ///
48 void mathmlize(MathStream & ms) const;
49 /// identifies SpecialChar insets
50 InsetMathSpecialChar const * asSpecialCharInset() const { return this; }
51 ///
52 docstring name() const { return name_; }
53 ///
54 char_type getChar() const { return char_; }
55 ///
56 InsetCode lyxCode() const { return MATH_SPECIALCHAR_CODE; }
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_;
68 } // namespace lyx
70 #endif // MATH_SPECIALCHARINSET_H