5 #include "math_nestinset.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 MathNestInset {
19 /// additional per-row information
29 /// hline abow this row?
31 /// hline below this row?
35 // additional per-row information
55 MathGridInset(int m, int n, string const & nm);
57 void write(std::ostream &, bool fragile) const;
59 void metrics(MathStyles st) const;
61 void draw(Painter &, int x, int y) const;
63 void halign(string const &);
65 void halign(char c, int col);
67 char halign(int col) const;
73 void resize(short int type, int cols);
75 const RowInfo & rowinfo(int row) const;
77 RowInfo & rowinfo(int row);
79 bool isGrid() const { return true; }
82 int ncols() const { return colinfo_.size(); }
84 int nrows() const { return rowinfo_.size(); }
86 int col(int idx) const { return idx % ncols(); }
88 int row(int idx) const { return idx / ncols(); }
91 bool idxUp(int &, int &) const;
93 bool idxDown(int &, int &) const;
95 bool idxLeft(int &, int &) const;
97 bool idxRight(int &, int &) const;
99 bool idxFirst(int &, int &) const;
101 bool idxLast(int &, int &) const;
103 void idxDelete(int &, bool &, bool &);
105 void idxDeleteRange(int, int);
116 virtual void appendRow();
118 int index(int row, int col) const;
120 std::vector<int> idxBetween(int from, int to) const;
124 std::vector<RowInfo> rowinfo_;
126 std::vector<ColInfo> colinfo_;
128 char v_align_; // add approp. type