3 * \file InsetMathClass.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_CLASSINSET_H
13 #define MATH_CLASSINSET_H
15 #include "MathClass.h"
17 #include "InsetMathNest.h"
23 /// Support for LaTeX's \\mathxxx class-changing commands
25 class InsetMathClass : public InsetMathNest {
28 InsetMathClass(Buffer * buf, MathClass);
30 docstring name() const override;
32 MathClass mathClass() const override { return math_class_; }
33 /// The default limits value in \c display style
34 Limits defaultLimits(bool display) const override;
35 /// whether the inset has limit-like sub/superscript
36 Limits limits() const override { return limits_; }
37 /// sets types of sub/superscripts
38 void limits(Limits lim) override { limits_ = lim; }
40 void metrics(MetricsInfo & mi, Dimension & dim) const override;
42 void draw(PainterInfo & pi, int x, int y) const override;
44 void write(TeXMathStream & os) const override;
46 void infoize(odocstream & os) const override;
48 InsetCode lyxCode() const override { return MATH_CLASS_CODE; }
50 InsetMathClass * asClassInset() { return this; }
52 InsetMathClass const * asClassInset() const override { return this; }
55 Inset * clone() const override;
57 MathClass math_class_;
59 Limits limits_ = AUTO_LIMITS;