#ifndef MATH_MATRIXINSET_H
#define MATH_MATRIXINSET_H
-#include <vector>
-
-#include "math_parinset.h"
+#include "math_gridinset.h"
#ifdef __GNUG__
#pragma interface
like array and eqnarray.
\author Alejandro Aguilar Sierra
*/
-class MathMatrixInset : public MathParInset {
+
+class LaTeXFeatures;
+
+class MathMatrixInset : public MathGridInset {
public:
///
- explicit
- MathMatrixInset(int m, int n, short st = LM_ST_TEXT);
+ MathMatrixInset();
///
- explicit
- MathMatrixInset(MathMatrixInset const &);
+ explicit MathMatrixInset(MathInsetTypes t);
///
- ~MathMatrixInset();
+ MathMatrixInset(MathInsetTypes t, unsigned int cols);
///
- MathedInset * Clone();
+ MathInset * clone() const;
///
- void draw(Painter &, int, int);
+ void write(std::ostream &, bool fragile) const;
///
- void Write(std::ostream &, bool fragile);
+ void metrics(MathStyles st) const;
///
- void Metrics();
+ void draw(Painter &, int x, int y) const;
///
- void setData(MathedArray const &);
+ string label(unsigned int row) const;
///
- void SetAlign(char, string const &);
+ void label(unsigned int row, string const & label);
///
- int GetColumns() const;
+ void numbered(unsigned int row, bool num);
///
- int GetRows() const;
+ bool numbered(unsigned int row) const;
///
- virtual bool isMatrix() const;
-
- /// Use this to manage the extra information independently of paragraph
- MathedRowContainer & getRowSt();
-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
- MathedRowContainer row_;
-};
+ bool numberedType() const;
+ ///
+ bool display() const;
+ ///
+ bool ams() const;
+ ///
+ std::vector<string> const getLabelList() const;
+ ///
+ void validate(LaTeXFeatures & features) const;
+ ///
+ void addRow(unsigned int);
+ ///
+ void delRow(unsigned int);
+ ///
+ void addCol(unsigned int);
+ ///
+ void delCol(unsigned int);
+ ///
+ void appendRow();
-inline
-int MathMatrixInset::GetColumns() const
-{
- return nc_;
-}
+ /// change type
+ void mutate(string const &);
+ ///
+ void mutate(MathInsetTypes);
+ ///
+ int defaultColSpace(unsigned int col);
+ ///
+ char defaultColAlign(unsigned int col);
-inline
-int MathMatrixInset::GetRows() const
-{
- return nr_;
-}
+ ///
+ MathInsetTypes getType() const;
+private:
+ ///
+ void setType(MathInsetTypes t);
+ ///
+ void validate1(LaTeXFeatures & features);
+ ///
+ void header_write(std::ostream &) const;
+ ///
+ void footer_write(std::ostream &) const;
+ ///
+ void glueall();
+ ///
+ string nicelabel(unsigned int row) const;
-inline
-bool MathMatrixInset::isMatrix() const
-{
- return true;
-}
-
+ ///
+ MathInsetTypes objtype_;
+ ///
+ std::vector<int> nonum_;
+ ///
+ std::vector<string> label_;
+};
-inline
-MathedRowContainer & MathMatrixInset::getRowSt()
-{
- return row_;
-}
#endif