// -*- C++ -*-
+/**
+ * \file math_matrixinset.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
#ifndef MATH_MATRIXINSET_H
#define MATH_MATRIXINSET_H
-#include <vector>
+#include "math_gridinset.h"
-#include "math_parinset.h"
-/** Multiline math paragraph base class.
- This is the base to all multiline editable math objects
- like array and eqnarray.
- \author Alejandro Aguilar Sierra
-*/
-class MathMatrixInset : public MathParInset {
-public:
- ///
- explicit
- MathMatrixInset(int m = 1, int n = 1, short st = LM_ST_TEXT);
- ///
- explicit
- MathMatrixInset(MathMatrixInset *);
- ///
- MathedInset * Clone();
- ///
- virtual ~MathMatrixInset();
- ///
- void draw(Painter &, int, int);
+// "shortcut" for DelimInset("(",ArrayInset,")")
+
+class MathMatrixInset : public MathGridInset {
+public:
///
- void Write(std::ostream &, bool fragile);
+ explicit MathMatrixInset(MathGridInset const &);
///
- void Metrics();
+ explicit MathMatrixInset(std::string const & str);
+ /// identifies MatrixInsets
+ MathMatrixInset const * asMatrixInset() const { return this; }
+
///
- void setData(MathedArray const &);
+ void write(WriteStream & os) const;
///
- void SetAlign(char, string const &);
+ void normalize(NormalStream &) const;
///
- int GetColumns() const;
+ void maple(MapleStream &) const;
///
- int GetRows() const;
+ void maxima(MaximaStream &) const;
///
- virtual bool isMatrix() const;
-
- /// Use this to manage the extra information independently of paragraph
- MathedRowSt * getRowSt() const;
+ void mathmlize(MathMLStream &) const;
///
- void setRowSt(MathedRowSt * r);
+ void octave(OctaveStream &) const;
private:
- /// Number of columns & rows
- int nc_;
- ///
- int nr_;
- /// tab sizes
- std::vector<int> ws_;
- ///
- char v_align_; // add approp. type
- ///
- //std::vector<char> h_align;
- string h_align_; // a vector would perhaps be more correct
- /// Vertical structure
- MathedRowSt * row_;
+ virtual std::auto_ptr<InsetBase> doClone() const;
};
-
-inline
-int MathMatrixInset::GetColumns() const
-{
- return nc_;
-}
-
-
-inline
-int MathMatrixInset::GetRows() const
-{
- return nr_;
-}
-
-
-inline
-bool MathMatrixInset::isMatrix() const
-{
- return true;
-}
-
-
-inline
-MathedRowSt * MathMatrixInset::getRowSt() const
-{
- return row_;
-}
-
-
-inline
-void MathMatrixInset::setRowSt(MathedRowSt * r)
-{
- row_ = r;
-}
#endif