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