]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathSymbol.h
use bald pointers in clone()
[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         bool metrics(MetricsInfo & mi, Dimension & dim) const;
37         ///
38         void draw(PainterInfo &, int x, int y) const;
39         ///
40         int kerning() const { return kerning_; }
41
42         ///
43         bool isRelOp() const;
44         ///
45         bool isOrdAlpha() const;
46         /// do we take scripts?
47         bool isScriptable() const;
48         /// do we take \limits or \nolimits?
49         bool takesLimits() const;
50         /// identifies SymbolInset as such
51         InsetMathSymbol const * asSymbolInset() const { return this; }
52         /// the LaTeX name of the symbol (without the backslash)
53         docstring name() const;
54         /// request "external features"
55         void validate(LaTeXFeatures & features) const;
56
57         ///
58         void normalize(NormalStream &) const;
59         ///
60         void maple(MapleStream &) const;
61         ///
62         void maxima(MaximaStream &) const;
63         ///
64         void mathematica(MathematicaStream &) const;
65         ///
66         void mathmlize(MathStream &) const;
67         ///
68         void octave(OctaveStream &) const;
69         ///
70         void write(WriteStream & os) const;
71         ///
72         void infoize2(odocstream & os) const;
73
74 private:
75         virtual Inset * clone() const;
76         ///
77         latexkeys const * sym_;
78         ///
79         mutable int h_;
80         /// cached superscript kerning
81         mutable int kerning_;
82         ///
83         mutable bool scriptable_;
84 };
85
86 } // namespace lyx
87
88 #endif