]> git.lyx.org Git - lyx.git/blob - src/mathed/math_matrixinset.h
mathed33.diff
[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     \author Alejandro Aguilar Sierra
13 */
14 class MathMatrixInset : public MathParInset {
15 public: 
16         ///
17         explicit
18         MathMatrixInset(int m = 1, int n = 1, short st = LM_ST_TEXT);
19         ///
20         explicit
21         MathMatrixInset(MathMatrixInset *);
22         ///
23         MathedInset * Clone();
24         ///
25         virtual ~MathMatrixInset();
26         ///
27         void draw(Painter &, int, int);
28         ///
29         void Write(std::ostream &, bool fragile);
30         ///
31         void Metrics();
32         ///
33         void setData(MathedArray const &);
34         ///
35         void SetAlign(char, string const &);
36         ///
37         int GetColumns() const;
38         ///
39         int GetRows() const;
40         ///
41         virtual bool isMatrix() const;
42         
43         /// Use this to manage the extra information independently of paragraph
44         MathedRowSt * getRowSt() const;
45         ///
46         void setRowSt(MathedRowSt * r);
47 private:
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
64 inline
65 int MathMatrixInset::GetColumns() const
66 {
67         return nc_;
68 }
69
70
71 inline
72 int MathMatrixInset::GetRows() const
73 {
74         return nr_;
75 }
76
77
78 inline
79 bool MathMatrixInset::isMatrix() const
80 {
81         return true;
82 }
83         
84
85 inline
86 MathedRowSt * MathMatrixInset::getRowSt() const
87 {
88         return row_;
89 }
90
91
92 inline
93 void MathMatrixInset::setRowSt(MathedRowSt * r)
94 {
95         row_ = r;
96 }
97 #endif