]> git.lyx.org Git - lyx.git/blob - src/mathed/math_matrixinset.h
mathed49.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         explicit
22         MathMatrixInset(int m, int n, short st = LM_ST_TEXT);
23         ///
24         explicit
25         MathMatrixInset(MathMatrixInset const &);
26         ///
27         ~MathMatrixInset();
28         ///
29         MathedInset * Clone();
30         ///
31         void draw(Painter &, int, int);
32         ///
33         void Write(std::ostream &, bool fragile);
34         ///
35         void Metrics();
36         ///
37         void setData(MathedArray const &);
38         ///
39         void SetAlign(char, string const &);
40         ///
41         int GetColumns() const;
42         ///
43         int GetRows() const;
44         ///
45         virtual bool isMatrix() const;
46         
47         /// Use this to manage the extra information independently of paragraph
48         MathedRowContainer & getRowSt();
49 private:
50         ///  Number of columns & rows
51         int nc_;
52         ///
53         int nr_;
54         /// tab sizes
55         std::vector<int> ws_;   
56         /// 
57         char v_align_; // add approp. type
58         ///
59         //std::vector<char> h_align;
60         string h_align_; // a vector would perhaps be more correct
61         /// Vertical structure
62         MathedRowContainer row_;
63 };
64
65
66 inline
67 int MathMatrixInset::GetColumns() const
68 {
69         return nc_;
70 }
71
72
73 inline
74 int MathMatrixInset::GetRows() const
75 {
76         return nr_;
77 }
78
79
80 inline
81 bool MathMatrixInset::isMatrix() const
82 {
83         return true;
84 }
85         
86
87 inline
88 MathedRowContainer & MathMatrixInset::getRowSt()
89 {
90         return row_;
91 }
92 #endif