]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathChar.h
* src/mathed/InsetMathNest.C
[lyx.git] / src / mathed / InsetMathChar.h
1 // -*- C++ -*-
2 /**
3  * \file InsetMathChar.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 "InsetMath.h"
16
17
18 namespace lyx {
19
20 /// The base character inset.
21 class InsetMathChar : public InsetMath {
22 public:
23         ///
24         explicit InsetMathChar(char_type c);
25         ///
26         bool metrics(MetricsInfo & mi, Dimension & dim) const;
27         ///
28         void draw(PainterInfo & pi, int x, int y) const;
29         ///
30         void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
31         ///
32         void drawT(TextPainter &, int x, int y) const;
33         ///
34         int width() const { return width_; }
35
36         ///
37         void write(WriteStream & os) const;
38         ///
39         void normalize(NormalStream & ns) const;
40         ///
41         void octave(OctaveStream & os) const;
42         ///
43         void mathmlize(MathStream & ms) const;
44         /// identifies Charinsets
45         InsetMathChar const * asCharInset() const { return this; }
46         ///
47         char_type getChar() const { return char_; }
48         ///
49         bool isRelOp() const;
50
51 private:
52         virtual std::auto_ptr<InsetBase> doClone() const;
53         /// the character
54         char_type char_;
55         /// cached width
56         mutable int width_;
57 };
58
59 } // namespace lyx
60
61 #endif