2002-02-13 13:15:15 +00:00
|
|
|
// -*- C++ -*-
|
2002-12-01 22:59:25 +00:00
|
|
|
/**
|
2006-09-17 09:14:18 +00:00
|
|
|
* \file InsetMathAMSArray.h
|
2003-08-19 13:00:56 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-09-11 08:26:02 +00:00
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2002-09-11 08:26:02 +00:00
|
|
|
*
|
2003-08-19 13:00:56 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-09-11 08:26:02 +00:00
|
|
|
*/
|
2002-02-13 13:15:15 +00:00
|
|
|
|
2003-08-19 13:00:56 +00:00
|
|
|
#ifndef MATH_AMSARRAYINSET_H
|
|
|
|
#define MATH_AMSARRAYINSET_H
|
|
|
|
|
2006-09-17 09:14:18 +00:00
|
|
|
#include "InsetMathGrid.h"
|
2003-08-19 13:00:56 +00:00
|
|
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
2003-08-19 13:00:56 +00:00
|
|
|
/// Inset for things like [pbvV]matrix, psmatrix etc
|
2006-09-16 18:11:38 +00:00
|
|
|
class InsetMathAMSArray : public InsetMathGrid {
|
2002-03-21 17:42:56 +00:00
|
|
|
public:
|
2002-02-13 13:15:15 +00:00
|
|
|
///
|
2009-11-08 11:45:46 +00:00
|
|
|
InsetMathAMSArray(Buffer * buf, docstring const &, int m, int n);
|
2002-02-13 13:15:15 +00:00
|
|
|
///
|
2019-07-15 11:36:28 +00:00
|
|
|
InsetMathAMSArray(Buffer * buf, docstring const &); ///
|
|
|
|
|
|
|
|
///
|
|
|
|
int rowsep() const;
|
|
|
|
///
|
|
|
|
int colsep() const;
|
|
|
|
///
|
|
|
|
int border() const;
|
2002-02-13 13:15:15 +00:00
|
|
|
///
|
2007-09-21 20:39:47 +00:00
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const;
|
2002-02-13 13:15:15 +00:00
|
|
|
///
|
2003-03-21 14:20:48 +00:00
|
|
|
void draw(PainterInfo & pain, int x, int y) const;
|
2002-02-13 13:15:15 +00:00
|
|
|
///
|
2006-09-16 18:11:38 +00:00
|
|
|
InsetMathAMSArray * asAMSArrayInset() { return this; }
|
2002-08-09 07:01:17 +00:00
|
|
|
///
|
2006-09-16 18:11:38 +00:00
|
|
|
InsetMathAMSArray const * asAMSArrayInset() const { return this; }
|
2002-02-13 13:15:15 +00:00
|
|
|
|
2005-04-03 12:07:49 +00:00
|
|
|
///
|
2007-04-26 14:56:30 +00:00
|
|
|
bool getStatus(Cursor & cur, FuncRequest const & cmd,
|
2005-04-03 12:07:49 +00:00
|
|
|
FuncStatus & flag) const;
|
2002-02-13 13:15:15 +00:00
|
|
|
///
|
|
|
|
void write(WriteStream & os) const;
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
void infoize(odocstream & os) const;
|
2005-04-03 12:07:49 +00:00
|
|
|
///
|
2002-02-13 13:15:15 +00:00
|
|
|
void normalize(NormalStream &) const;
|
2017-07-03 17:45:58 +00:00
|
|
|
// Don't need mathmlize or htmlize, as this is handled by
|
2010-07-29 14:29:54 +00:00
|
|
|
// InsetMathMatrix after being extracted in MathExtern.
|
2009-12-31 23:31:30 +00:00
|
|
|
// void mathmlize(MathStream &) const;
|
2010-07-29 14:29:54 +00:00
|
|
|
// void htmlize(HTMLStream &) const;
|
2005-03-30 09:05:30 +00:00
|
|
|
///
|
|
|
|
void validate(LaTeXFeatures & features) const;
|
2009-07-16 19:00:24 +00:00
|
|
|
///
|
|
|
|
InsetCode lyxCode() const { return MATH_AMSARRAY_CODE; }
|
2002-02-13 13:15:15 +00:00
|
|
|
///
|
|
|
|
char const * name_left() const;
|
|
|
|
///
|
|
|
|
char const * name_right() const;
|
2016-09-29 18:20:33 +00:00
|
|
|
///
|
2019-07-15 11:36:28 +00:00
|
|
|
int leftMargin() const { return small() ? 3 : 6; } //override
|
2016-09-29 18:20:33 +00:00
|
|
|
///
|
2019-07-15 11:36:28 +00:00
|
|
|
int rightMargin() const { return small() ? 3: 6; } //override
|
2016-11-03 22:23:11 +00:00
|
|
|
///
|
|
|
|
bool handlesMulticolumn() const { return true; } //override
|
2016-09-29 18:20:33 +00:00
|
|
|
|
2009-12-16 17:01:09 +00:00
|
|
|
private:
|
|
|
|
virtual Inset * clone() const;
|
2002-02-13 13:15:15 +00:00
|
|
|
///
|
2019-07-15 11:36:28 +00:00
|
|
|
bool small() const { return name_ == "smallmatrix"; }
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
docstring name_;
|
2002-02-13 13:15:15 +00:00
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
} // namespace lyx
|
|
|
|
|
2002-02-13 13:15:15 +00:00
|
|
|
#endif
|