]> git.lyx.org Git - lyx.git/blob - src/mathed/math_matrixinset.h
mathed50.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 #ifdef __GNUG__
10 #pragma interface
11 #endif
12
13 /** Multiline math paragraph base class.
14     This is the base to all multiline editable math objects
15     like array and eqnarray.
16     \author Alejandro Aguilar Sierra
17 */
18 class MathMatrixInset : public MathParInset {
19 public: 
20         ///
21         MathMatrixInset(int m, int n, short st = LM_ST_TEXT);
22         ///
23         MathedInset * Clone();
24         ///
25         void draw(Painter &, int, int);
26         ///
27         void Write(std::ostream &, bool fragile);
28         ///
29         void Metrics();
30         ///
31         void setData(MathedArray const &);
32         ///
33         void SetAlign(char, string const &);
34         ///
35         int GetColumns() const;
36         ///
37         int GetRows() const;
38         ///
39         virtual bool isMatrix() const;
40         
41         /// Use this to manage the extra information independently of paragraph
42         MathedRowContainer & getRowSt();
43 private:
44         ///  Number of columns & rows
45         int nc_;
46         ///
47         int nr_;
48         /// tab sizes
49         std::vector<int> ws_;   
50         /// 
51         char v_align_; // add approp. type
52         ///
53         //std::vector<char> h_align;
54         string h_align_; // a vector would perhaps be more correct
55         /// Vertical structure
56         MathedRowContainer row_;
57 };
58
59
60 inline
61 int MathMatrixInset::GetColumns() const
62 {
63         return nc_;
64 }
65
66
67 inline
68 int MathMatrixInset::GetRows() const
69 {
70         return nr_;
71 }
72
73
74 inline
75 bool MathMatrixInset::isMatrix() const
76 {
77         return true;
78 }
79         
80
81 inline
82 MathedRowContainer & MathMatrixInset::getRowSt()
83 {
84         return row_;
85 }
86 #endif