5 #include "math_nestinset.h"
12 /** Gridded math inset base class.
13 This is the base to all grid-like editable math objects
14 like array and eqnarray.
15 \author André Pönitz 2001
18 class MathGridInset : public MathNestInset {
20 /// additional per-row information
30 /// hline abow this row?
32 /// hline below this row?
36 // additional per-row information
56 MathGridInset(int m, int n);
58 void write(std::ostream &, bool fragile) const;
60 void metrics(MathStyles st) const;
62 void draw(Painter &, int x, int y) const;
64 void halign(string const &);
66 void halign(char c, int col);
68 char halign(int col) const;
74 void resize(short int type, int cols);
76 const RowInfo & rowinfo(int row) const;
78 RowInfo & rowinfo(int row);
80 bool isGrid() const { return true; }
83 int ncols() const { return colinfo_.size(); }
85 int nrows() const { return rowinfo_.size(); }
87 int col(int idx) const { return idx % ncols(); }
89 int row(int idx) const { return idx / ncols(); }
91 int cellXOffset(int idx) const;
93 int cellYOffset(int idx) const;
96 bool idxUp(int &, int &) const;
98 bool idxDown(int &, int &) const;
100 bool idxLeft(int &, int &) const;
102 bool idxRight(int &, int &) const;
104 bool idxFirst(int &, int &) const;
106 bool idxLast(int &, int &) const;
108 void idxDelete(int &, bool &, bool &);
110 void idxDeleteRange(int, int);
121 virtual void appendRow();
123 int index(int row, int col) const;
125 std::vector<int> idxBetween(int from, int to) const;
129 std::vector<RowInfo> rowinfo_;
131 std::vector<ColInfo> colinfo_;
133 char v_align_; // add approp. type