]> git.lyx.org Git - lyx.git/blob - src/mathed/math_charinset.h
629e93e46332243e114421e1bbf37b75f3c46c57
[lyx.git] / src / mathed / math_charinset.h
1 // -*- C++ -*-
2 #ifndef MATH_CHARINSET_H
3 #define MATH_CHARINSET_H
4
5 #include "math_inset.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 MathInset {
16 public:
17         ///
18         explicit MathCharInset(char c);
19         ///
20         MathCharInset(char c, MathTextCodes t);
21         ///
22         MathInset * clone() const;
23         ///
24         MathTextCodes nativeCode(char c) const;
25         ///
26         void metrics(MathStyles st) const;
27         ///
28         void draw(Painter &, int x, int y) const;
29         ///
30         void write(std::ostream &, bool fragile) const;
31         ///
32         void writeNormal(std::ostream &) const;
33         /// 
34         int ascent() const;
35         ///
36         int descent() const;
37         ///
38         int width() const;
39         /// identifies Charinsets
40         bool isCharInset() const { return true; }
41         ///
42         char getChar() const { return char_; }
43         ///
44         MathTextCodes code() const { return code_; }
45         ///
46         bool isRelOp() const;
47         ///
48         void handleFont(MathTextCodes t);
49
50 private:
51         /// the character
52         char char_;
53         /// 
54         MathTextCodes code_;
55 };
56 #endif