5 #include "math_inset.h"
11 /** Gridded math inset base class.
12 This is the base to all grid-like editable math objects
13 like array and eqnarray.
14 \author André Pönitz 2001
17 class MathGridInset : public MathInset {
19 /// additional per-row information
35 // additional per-row information
55 MathGridInset(int m, int n, string const & nm);
57 virtual MathInset * clone() const = 0;
59 void write(std::ostream &, bool fragile) const;
61 void metrics(MathStyles st);
63 void draw(Painter &, int, int);
65 void halign(string const &);
67 void halign(char c, int col);
69 char halign(int col) const;
75 void resize(short int type, int cols);
77 const RowInfo & rowinfo(int row) const;
79 RowInfo & rowinfo(int row);
81 bool isGrid() const { return true; }
84 int ncols() const { return colinfo_.size(); }
86 int nrows() const { return rowinfo_.size(); }
88 int col(int idx) const { return idx % ncols(); }
90 int row(int idx) const { return idx / ncols(); }
93 bool idxUp(int &, int &) const;
95 bool idxDown(int &, int &) const;
97 bool idxLeft(int &, int &) const;
99 bool idxRight(int &, int &) const;
101 bool idxFirst(int &, int &) const;
103 bool idxLast(int &, int &) const;
105 void idxDelete(int &, bool &, bool &);
107 void idxDeleteRange(int, int);
118 virtual void appendRow();
120 int index(int row, int col) const;
122 std::vector<int> idxBetween(int from, int to) const;
126 std::vector<RowInfo> rowinfo_;
128 std::vector<ColInfo> colinfo_;
130 char v_align_; // add approp. type