]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathSymbol.h
Revert "XHTML: remove DOCTYPE, as the document is then understood as HTML4/XHTML1...
[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 // \xxx symbols that may take limits or grow in displayed formulæ.
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(docstring const & name);
31         ///
32         void metrics(MetricsInfo & mi, Dimension & dim) const;
33         ///
34         void draw(PainterInfo &, int x, int y) const;
35         ///
36         int kerning(BufferView const *) const { return kerning_; }
37
38         ///
39         mode_type currentMode() const;
40         ///
41         MathClass mathClass() const;
42         ///
43         bool isOrdAlpha() const;
44         /// The default limits value
45         Limits defaultLimits() const;
46         /// whether the inset has limit-like sub/superscript
47         Limits limits() const { return limits_; }
48         /// sets types of sub/superscripts
49         void limits(Limits lim) { limits_ = lim; }
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         Limits limits_ = AUTO_LIMITS;
87
88         // FIXME: these depend on BufferView
89
90         ///
91         mutable int h_ = 0;
92         /// cached superscript kerning
93         mutable int kerning_ = 0;
94 };
95
96 } // namespace lyx
97
98 #endif