3 * \file InsetMathSymbol.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef MATH_SYMBOLINSET_H
13 #define MATH_SYMBOLINSET_H
15 #include "InsetMath.h"
22 // \xxx symbols that may take limits or grow in displayed formulæ.
23 class InsetMathSymbol : public InsetMath {
26 explicit InsetMathSymbol(latexkeys const * l);
28 explicit InsetMathSymbol(char const * name);
30 explicit InsetMathSymbol(docstring const & name);
32 void metrics(MetricsInfo & mi, Dimension & dim) const override;
34 void draw(PainterInfo &, int x, int y) const override;
36 int kerning(BufferView const *) const override { return kerning_; }
39 mode_type currentMode() const override;
41 MathClass mathClass() const override;
43 bool isOrdAlpha() const;
44 /// The default limits value
45 Limits defaultLimits(bool display) const override;
46 /// whether the inset has limit-like sub/superscript
47 Limits limits() const override { return limits_; }
48 /// sets types of sub/superscripts
49 void limits(Limits lim) override { limits_ = lim; }
50 /// identifies SymbolInset as such
51 InsetMathSymbol const * asSymbolInset() const override { return this; }
52 /// the LaTeX name of the symbol (without the backslash)
53 docstring name() const override;
54 /// request "external features"
55 void validate(LaTeXFeatures & features) const override;
58 void normalize(NormalStream &) const override;
60 void maple(MapleStream &) const override;
62 void maxima(MaximaStream &) const override;
64 void mathematica(MathematicaStream &) const override;
66 void mathmlize(MathMLStream &) const override;
68 void htmlize(HtmlStream &) const override;
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;
73 void octave(OctaveStream &) const override;
75 void write(TeXMathStream & os) const override;
77 void infoize2(odocstream & os) const override;
79 InsetCode lyxCode() const override { return MATH_SYMBOL_CODE; }
82 Inset * clone() const override;
84 latexkeys const * sym_;
86 Limits limits_ = AUTO_LIMITS;
88 // FIXME: these depend on BufferView
92 /// cached superscript kerning
93 mutable int kerning_ = 0;