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