]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathSymbol.h
Temporarily fix cursor positioning within mathed.
[lyx.git] / src / mathed / InsetMathSymbol.h
1 // -*- C++ -*-
2 /**
3  * \file InsetMathSymbol.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_SYMBOLINSET_H
13 #define MATH_SYMBOLINSET_H
14
15 #include "InsetMath.h"
16
17 #include "Font.h"
18
19 namespace lyx {
20
21 class latexkeys;
22
23
24 /** "normal" symbols that don't take limits and don't grow in displayed
25  *  formulae.
26  */
27 class InsetMathSymbol : public InsetMath {
28 public:
29         ///
30         explicit InsetMathSymbol(latexkeys const * l);
31         ///
32         explicit InsetMathSymbol(char const * name);
33         ///
34         explicit InsetMathSymbol(docstring const & name);
35         ///
36         void metrics(MetricsInfo & mi, Dimension & dim) const;
37         ///
38         Dimension const dimension(BufferView const &) const { return dim_; }
39         ///
40         void draw(PainterInfo &, int x, int y) const;
41         ///
42         int kerning() const { return kerning_; }
43
44         ///
45         bool isRelOp() const;
46         ///
47         bool isOrdAlpha() const;
48         /// do we take scripts?
49         bool isScriptable() const;
50         /// do we take \limits or \nolimits?
51         bool takesLimits() const;
52         /// identifies SymbolInset as such
53         InsetMathSymbol const * asSymbolInset() const { return this; }
54         /// the LaTeX name of the symbol (without the backslash)
55         docstring name() const;
56         /// request "external features"
57         void validate(LaTeXFeatures & features) const;
58
59         ///
60         void normalize(NormalStream &) const;
61         ///
62         void maple(MapleStream &) const;
63         ///
64         void maxima(MaximaStream &) const;
65         ///
66         void mathematica(MathematicaStream &) const;
67         ///
68         void mathmlize(MathStream &) const;
69         ///
70         void octave(OctaveStream &) const;
71         ///
72         void write(WriteStream & os) const;
73         ///
74         void infoize2(odocstream & os) const;
75
76 private:
77         virtual Inset * clone() const;
78         ///
79         latexkeys const * sym_;
80         ///
81         mutable int h_;
82         /// cached superscript kerning
83         mutable int kerning_;
84         ///
85         mutable bool scriptable_;
86         /// FIXME: move this out to BufferView
87         mutable Dimension dim_;
88 };
89
90 } // namespace lyx
91
92 #endif