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