3 * \file InsetMathMacroArgument.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Alejandro Aguilar Sierra
10 * Full author contact details are available in file CREDITS.
13 #ifndef MATHMACROARGUMENT_H
14 #define MATHMACROARGUMENT_H
16 #include "InsetMath.h"
18 #include "support/docstring.h"
24 // A # that failed to parse
25 class InsetMathHash : public InsetMath {
27 explicit InsetMathHash(Buffer * buf, docstring const & str = docstring())
28 : InsetMath(buf), str_('#' + str) {}
30 void metrics(MetricsInfo & mi, Dimension & dim) const override;
32 void draw(PainterInfo &, int x, int y) const override;
34 void normalize(NormalStream &) const override;
36 void write(TeXMathStream & os) const override;
39 Inset * clone() const override;
48 class InsetMathMacroArgument : public InsetMathHash {
50 /// Assumes 0 < number <= 9
51 explicit InsetMathMacroArgument(Buffer * buf, int number);
53 int number() const { return number_; }
54 /// Assumes 0 < n <= 9
55 void setNumber(int n);
57 InsetCode lyxCode() const override { return MATH_MACROARG_CODE; }
60 void normalize(NormalStream &) const override;
63 Inset * clone() const override;
64 /// A number between 1 and 9