]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathAMSArray.h
Substack should not be allowed to change columns
[lyx.git] / src / mathed / InsetMathAMSArray.h
1 // -*- C++ -*-
2 /**
3  * \file InsetMathAMSArray.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_AMSARRAYINSET_H
13 #define MATH_AMSARRAYINSET_H
14
15 #include "InsetMathGrid.h"
16
17
18 namespace lyx {
19
20 /// Inset for things like [pbvV]matrix, psmatrix etc
21 class InsetMathAMSArray : public InsetMathGrid {
22 public:
23         ///
24         InsetMathAMSArray(Buffer * buf, docstring const &, int m, int n);
25         ///
26         InsetMathAMSArray(Buffer * buf, docstring const &);     ///
27
28         ///
29         int rowsep() const override;
30         ///
31         int colsep() const override;
32         ///
33         int border() const override;
34         ///
35         void metrics(MetricsInfo & mi, Dimension & dim) const override;
36         ///
37         void draw(PainterInfo & pi, int x, int y) const override;
38         ///
39         InsetMathAMSArray * asAMSArrayInset() override { return this; }
40         ///
41         InsetMathAMSArray const * asAMSArrayInset() const override { return this; }
42
43         ///
44         bool getStatus(Cursor & cur, FuncRequest const & cmd,
45                 FuncStatus & flag) const override;
46         ///
47         void write(TeXMathStream & os) const override;
48         ///
49         void infoize(odocstream & os) const override;
50         ///
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;
56         ///
57         void validate(LaTeXFeatures & features) const override;
58         ///
59         InsetCode lyxCode() const override { return MATH_AMSARRAY_CODE; }
60         ///
61         char const * name_left() const;
62         ///
63         char const * name_right() const;
64         ///
65         int leftMargin() const override { return small() ? 3 : 6; }
66         ///
67         int rightMargin() const override { return small() ? 3: 6; }
68         ///
69         bool handlesMulticolumn() const override { return true; }
70
71 private:
72         Inset * clone() const override;
73         ///
74         bool small() const { return name_ == "smallmatrix"; }
75         ///
76         docstring name_;
77 };
78
79 } // namespace lyx
80
81 #endif