]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathSpecialChar.h
* temporary fix for the crash of the pixmap cache on Mac with Qt 4.4.
[lyx.git] / src / mathed / InsetMathSpecialChar.h
1 // -*- C++ -*-
2 /**
3  * \file InsetMathSpecialChar.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Enrico Forestieri
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef MATH_SPECIALCHARINSET_H
13 #define MATH_SPECIALCHARINSET_H
14
15 #include "InsetMath.h"
16
17 namespace lyx {
18
19 /// The special character inset.
20 class InsetMathSpecialChar : public InsetMath {
21 public:
22         ///
23         explicit InsetMathSpecialChar(docstring name);
24         ///
25         void setBuffer(Buffer &) {}
26         ///
27         void metrics(MetricsInfo & mi, Dimension & dim) const;
28         ///
29         void draw(PainterInfo & pi, int x, int y) const;
30         ///
31         void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
32         ///
33         void drawT(TextPainter &, int x, int y) const;
34         ///
35         int kerning(BufferView const *) const { return kerning_; }
36         ///
37         void write(WriteStream & os) const;
38         ///
39         void validate(LaTeXFeatures & features) const;
40         ///
41         void normalize(NormalStream & ns) const;
42         ///
43         void octave(OctaveStream & os) const;
44         ///
45         void maple(MapleStream &) const;
46         ///
47         void mathematica(MathematicaStream &) const;
48         ///
49         void mathmlize(MathStream & ms) const;
50         /// identifies SpecialChar insets
51         InsetMathSpecialChar const * asSpecialCharInset() const { return this; }
52         ///
53         docstring name() const { return name_; }
54         ///
55         char_type getChar() const { return char_; }
56
57 private:
58         virtual Inset * clone() const;
59         /// the latex name
60         docstring name_;
61         /// the displayed character
62         char_type char_;
63         /// cached kerning for superscript
64         mutable int kerning_;
65 };
66
67 } // namespace lyx
68
69 #endif