* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author André Pönitz
+ * \author André Pönitz
*
* Full author contact details are available in file CREDITS.
*/
#include "InsetMathGrid.h"
+namespace lyx {
+
/// Inset for things like [pbvV]matrix, psmatrix etc
class InsetMathAMSArray : public InsetMathGrid {
public:
///
- InsetMathAMSArray(std::string const & name, int m, int n);
+ InsetMathAMSArray(Buffer * buf, docstring const &, int m, int n);
+ ///
+ InsetMathAMSArray(Buffer * buf, docstring const &); ///
+
+ ///
+ int rowsep() const override;
///
- InsetMathAMSArray(std::string const & name);
+ int colsep() const override;
///
- void metrics(MetricsInfo & mi, Dimension & dim) const;
+ int border() const override;
///
- void draw(PainterInfo & pain, int x, int y) const;
+ void metrics(MetricsInfo & mi, Dimension & dim) const override;
///
- InsetMathAMSArray * asAMSArrayInset() { return this; }
+ void draw(PainterInfo & pi, int x, int y) const override;
///
- InsetMathAMSArray const * asAMSArrayInset() const { return this; }
+ InsetMathAMSArray * asAMSArrayInset() override { return this; }
+ ///
+ InsetMathAMSArray const * asAMSArrayInset() const override { return this; }
///
- bool getStatus(LCursor & cur, FuncRequest const & cmd,
- FuncStatus & flag) const;
+ bool getStatus(Cursor & cur, FuncRequest const & cmd,
+ FuncStatus & flag) const override;
///
- void write(WriteStream & os) const;
+ void write(WriteStream & os) const override;
///
- void infoize(std::ostream & os) const;
+ void infoize(odocstream & os) const override;
///
- void normalize(NormalStream &) const;
+ void normalize(NormalStream &) const override;
+ // Don't need mathmlize or htmlize, as this is handled by
+ // InsetMathMatrix after being extracted in MathExtern.
+ // void mathmlize(MathStream &) const override;
+ // void htmlize(HtmlStream &) const override;
///
- void validate(LaTeXFeatures & features) const;
-private:
- virtual std::auto_ptr<InsetBase> doClone() const;
+ void validate(LaTeXFeatures & features) const override;
+ ///
+ InsetCode lyxCode() const override { return MATH_AMSARRAY_CODE; }
///
char const * name_left() const;
///
char const * name_right() const;
+ ///
+ int leftMargin() const override { return small() ? 3 : 6; }
+ ///
+ int rightMargin() const override { return small() ? 3: 6; }
+ ///
+ bool handlesMulticolumn() const override { return true; }
+private:
+ Inset * clone() const override;
+ ///
+ bool small() const { return name_ == "smallmatrix"; }
///
- std::string name_;
+ docstring name_;
};
+} // namespace lyx
+
#endif