3 * \file InsetMathAMSArray.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_AMSARRAYINSET_H
13 #define MATH_AMSARRAYINSET_H
15 #include "InsetMathGrid.h"
20 /// Inset for things like [pbvV]matrix, psmatrix etc
21 class InsetMathAMSArray : public InsetMathGrid {
24 InsetMathAMSArray(Buffer * buf, docstring const &, int m, int n);
26 InsetMathAMSArray(Buffer * buf, docstring const &); ///
29 int rowsep() const override;
31 int colsep() const override;
33 int border() const override;
35 void metrics(MetricsInfo & mi, Dimension & dim) const override;
37 void draw(PainterInfo & pi, int x, int y) const override;
39 InsetMathAMSArray * asAMSArrayInset() override { return this; }
41 InsetMathAMSArray const * asAMSArrayInset() const override { return this; }
44 bool getStatus(Cursor & cur, FuncRequest const & cmd,
45 FuncStatus & flag) const override;
47 void write(TeXMathStream & os) const override;
49 void infoize(odocstream & os) const override;
51 void normalize(NormalStream &) const override;
52 // Don't need mathmlize or htmlize, as this is handled by
53 // InsetMathMatrix after being extracted in MathExtern.
54 // void mathmlize(MathMLStream &) const override;
55 // void htmlize(HtmlStream &) const override;
57 void validate(LaTeXFeatures & features) const override;
59 InsetCode lyxCode() const override { return MATH_AMSARRAY_CODE; }
61 char const * name_left() const;
63 char const * name_right() const;
65 int leftMargin() const override { return small() ? 3 : 6; }
67 int rightMargin() const override { return small() ? 3: 6; }
69 bool handlesMulticolumn() const override { return true; }
72 Inset * clone() const override;
74 bool small() const { return name_ == "smallmatrix"; }