]> git.lyx.org Git - lyx.git/blob - src/mathed/math_charinset.h
first shot at preview. It crashes. Don't know why. To see it work a bit, change
[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         MathInset * clone() const;
21         ///
22         void metrics(MathMetricsInfo & st) const;
23         ///
24         void draw(MathPainterInfo &, int x, int y) const;
25         ///
26         void metricsT(TextMetricsInfo const & st) const;
27         ///
28         void drawT(TextPainter &, int x, int y) const;
29         ///
30         void write(WriteStream & os) const;
31         ///
32         void normalize(NormalStream & ns) const;
33         ///
34         void octavize(OctaveStream & os) const;
35         /// identifies Charinsets
36         MathCharInset const * asCharInset() const { return this; }
37         ///
38         char getChar() const { return char_; }
39         ///
40         bool isRelOp() const;
41         ///
42         bool match(MathInset *) const;
43         /// identifies complicated things that need braces if used as arg
44         bool needsBraces() const { return false; }
45
46 private:
47         /// the character
48         char char_;
49 };
50 #endif