]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathSymbol.h
Account for old versions of Pygments
[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 *) const { return kerning_; }
39
40         ///
41         mode_type currentMode() const;
42         ///
43         MathClass mathClass() 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 htmlize(HtmlStream &) const;
69         /// \param spacing controls whether we print spaces around
70         /// "operator"-type symbols or just print them raw
71         void htmlize(HtmlStream &, bool spacing) const;
72         ///
73         void octave(OctaveStream &) const;
74         ///
75         void write(WriteStream & os) const;
76         ///
77         void infoize2(odocstream & os) const;
78         ///
79         InsetCode lyxCode() const { return MATH_SYMBOL_CODE; }
80
81 private:
82         virtual Inset * clone() const;
83         ///
84         latexkeys const * sym_;
85         ///
86         mutable int h_;
87         /// cached superscript kerning
88         mutable int kerning_;
89         ///
90         mutable bool scriptable_;
91 };
92
93 } // namespace lyx
94
95 #endif