]> git.lyx.org Git - lyx.git/blob - src/mathed/math_matrixinset.h
Applied Angus patch to compile on DEC C++ and to avoid name clashes
[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 private:
42         ///  Number of columns & rows
43         int nc_;
44         ///
45         int nr_;
46         /// tab sizes
47         std::vector<int> ws_;   
48         /// 
49         char v_align_; // add approp. type
50         ///
51         //std::vector<char> h_align;
52         string h_align_; // a vector would perhaps be more correct
53 };
54
55
56 inline
57 int MathMatrixInset::GetColumns() const
58 {
59         return nc_;
60 }
61
62
63 inline
64 int MathMatrixInset::GetRows() const
65 {
66         return nr_;
67 }
68
69
70 inline
71 bool MathMatrixInset::isMatrix() const
72 {
73         return true;
74 }
75         
76 #endif