]> git.lyx.org Git - lyx.git/blob - src/mathed/math_matrixinset.h
first go at mathed file cleanup
[lyx.git] / src / mathed / math_matrixinset.h
1 // -*- C++ -*-
2 #ifndef MATH_MATRIXINSET_H
3 #define MATH_MATRIXINSET_H
4
5 #include <vector>
6
7 #include "math_parinset.h"
8
9 /** Multiline math paragraph base class.
10     This is the base to all multiline editable math objects
11     like array and eqnarray. 
12  */
13 class MathMatrixInset: public MathParInset {
14  public: 
15     ///
16     explicit
17     MathMatrixInset(int m = 1, int n = 1, short st = LM_ST_TEXT);
18     ///
19     explicit
20     MathMatrixInset(MathMatrixInset *);
21     ///
22     MathedInset * Clone();
23     ///
24     virtual ~MathMatrixInset();
25     ///
26     void draw(Painter &, int, int);
27     ///
28     void Write(std::ostream &, bool fragile);
29     ///
30     void Metrics();
31     ///
32     void SetData(MathedArray *);
33     ///
34     void SetAlign(char, string const &);
35     ///
36     int GetColumns() const { return nc; }
37     ///
38     int GetRows() const { return nr; }
39     ///
40     virtual bool isMatrix() const { return true; }
41
42     /// Use this to manage the extra information independently of paragraph
43     MathedRowSt * getRowSt() const { return row; }
44     ///
45     void setRowSt(MathedRowSt * r) { row = r; }
46     
47  protected:
48     ///  Number of columns & rows
49     int nc;
50     ///
51     int nr;
52     /// tab sizes
53     std::vector<int> ws_;   
54     /// 
55     char v_align; // add approp. type
56     ///
57         //std::vector<char> h_align;
58         string h_align; // a vector would perhaps be more correct
59     /// Vertical structure
60     MathedRowSt * row;
61
62 };
63 #endif