]> git.lyx.org Git - lyx.git/blob - src/mathed/math_charinset.h
prepare hanling of chars the nee a backslash when written...
[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         MathCharInset(char c, MathTextCodes t, bool needbs);
23         ///
24         MathInset * clone() const;
25         ///
26         MathTextCodes nativeCode(char c) const;
27         ///
28         void metrics(MathStyles st) const;
29         ///
30         void draw(Painter &, int x, int y) const;
31         ///
32         void write(std::ostream &, bool fragile) const;
33         ///
34         void writeHeader(std::ostream &) const;
35         ///
36         void writeTrailer(std::ostream &) const;
37         ///
38         void writeRaw(std::ostream &) const;
39         ///
40         void writeNormal(std::ostream &) const;
41         /// 
42         int ascent() const;
43         ///
44         int descent() const;
45         ///
46         int width() const;
47         /// identifies Charinsets
48         MathCharInset const * asCharInset() const { return this; }
49         ///
50         char getChar() const { return char_; }
51         ///
52         MathTextCodes code() const { return code_; }
53         ///
54         bool isRelOp() const;
55         ///
56         void handleFont(MathTextCodes t);
57
58 private:
59         /// the character
60         char char_;
61         /// the font to be used on screen
62         MathTextCodes code_;
63         /// do wee need a backslash when writing LaTeX?
64         bool needbs_;
65 };
66 #endif