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, MathInsetTypes ot);
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);
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