]> git.lyx.org Git - lyx.git/blob - src/mathed/math_charinset.h
Fix event loop to no longer eat CPU
[lyx.git] / src / mathed / math_charinset.h
1 // -*- C++ -*-
2 /**
3  * \file math_charinset.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author André Pönitz
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef MATH_CHARINSET_H
13 #define MATH_CHARINSET_H
14
15 #include "math_inset.h"
16
17
18 /// The base character inset.
19 class MathCharInset : public MathInset {
20 public:
21         ///
22         explicit MathCharInset(char c);
23         ///
24         void metrics(MetricsInfo & mi, Dimension & dim) const;
25         ///
26         void draw(PainterInfo & pi, int x, int y) const;
27         ///
28         void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
29         ///
30         void drawT(TextPainter &, int x, int y) const;
31         ///
32         int width() const { return width_; }
33
34         ///
35         void write(WriteStream & os) const;
36         ///
37         void normalize(NormalStream & ns) const;
38         ///
39         void octave(OctaveStream & os) const;
40         ///
41         void mathmlize(MathMLStream & ms) const;
42         /// identifies Charinsets
43         MathCharInset const * asCharInset() const { return this; }
44         ///
45         char getChar() const { return char_; }
46         ///
47         bool isRelOp() const;
48
49 private:
50         virtual std::auto_ptr<InsetBase> doClone() const;
51         /// the character
52         char char_;
53         /// cached width
54         mutable int width_;
55 };
56 #endif