]> git.lyx.org Git - lyx.git/blob - src/mathed/math_charinset.h
Make Angus' compiler happy
[lyx.git] / src / mathed / math_charinset.h
1 // -*- C++ -*-
2 #ifndef MATH_CHARINSET_H
3 #define MATH_CHARINSET_H
4
5 #include "math_diminset.h"
6
7 #ifdef __GNUG__
8 #pragma interface
9 #endif
10
11 /** The base character inset.
12     \author André Pönitz
13  */
14
15 class MathCharInset : public MathDimInset {
16 public:
17         ///
18         explicit MathCharInset(char c);
19         ///
20         MathCharInset(char c, MathTextCodes t);
21         ///
22         MathInset * clone() const;
23         ///
24         static MathTextCodes nativeCode(char c);
25         ///
26         void metrics(MathMetricsInfo const & st) const;
27         ///
28         void draw(Painter &, int x, int y) const;
29         ///
30         void metricsT(TextMetricsInfo const & st) const;
31         ///
32         void drawT(TextPainter &, int x, int y) const;
33         ///
34         void write(WriteStream & os) const;
35         ///
36         void writeHeader(std::ostream &) const;
37         ///
38         void writeTrailer(std::ostream &) const;
39         ///
40         void writeRaw(std::ostream &) const;
41         ///
42         void normalize(NormalStream &) const;
43         /// identifies Charinsets
44         MathCharInset const * asCharInset() const { return this; }
45         ///
46         char getChar() const { return char_; }
47         ///
48         MathTextCodes code() const { return code_; }
49         ///
50         bool isRelOp() const;
51         ///
52         void validate(LaTeXFeatures & features) const;
53         ///
54         void handleFont(MathTextCodes t);
55         ///
56         bool match(MathInset *) const;
57         /// identifies complicated things that need braces if used as arg
58         bool needsBraces() const { return false; }
59
60 private:
61         /// the character
62         char char_;
63         /// the font to be used on screen
64         MathTextCodes code_;
65         ///
66         mutable LyXFont font_;
67 };
68 #endif