2 #ifndef MATH_CHARINSET_H
3 #define MATH_CHARINSET_H
5 #include "math_diminset.h"
11 /** The base character inset.
15 class MathCharInset : public MathDimInset {
18 explicit MathCharInset(char c);
20 MathCharInset(char c, MathTextCodes t);
22 MathInset * clone() const;
24 static MathTextCodes nativeCode(char c);
26 void metrics(MathMetricsInfo const & st) const;
28 void draw(Painter &, int x, int y) const;
30 void metricsT(TextMetricsInfo const & st) const;
32 void drawT(TextPainter &, int x, int y) const;
34 void write(WriteStream & os) const;
36 void writeHeader(std::ostream &) const;
38 void writeTrailer(std::ostream &) const;
40 void writeRaw(std::ostream &) const;
42 void normalize(NormalStream &) const;
43 /// identifies Charinsets
44 MathCharInset const * asCharInset() const { return this; }
46 char getChar() const { return char_; }
48 MathTextCodes code() const { return code_; }
52 void validate(LaTeXFeatures & features) const;
54 void handleFont(MathTextCodes t);
56 bool match(MathInset *) const;
57 /// identifies complicated things that need braces if used as arg
58 bool needsBraces() const { return false; }
63 /// the font to be used on screen
66 mutable LyXFont font_;