]> git.lyx.org Git - lyx.git/blob - src/mathed/math_matrixinset.h
some support for the [x][x]alignat environments
[lyx.git] / src / mathed / math_matrixinset.h
1 // -*- C++ -*-
2 #ifndef MATH_MATRIXINSET_H
3 #define MATH_MATRIXINSET_H
4
5 #include "math_gridinset.h"
6
7 #ifdef __GNUG__
8 #pragma interface
9 #endif
10
11 /** Multiline math paragraph base class.
12     This is the base to all multiline editable math objects
13     like array and eqnarray.
14     \author Alejandro Aguilar Sierra
15 */
16
17 class LaTeXFeatures;
18
19 class MathMatrixInset : public MathGridInset {
20 public: 
21         ///
22         MathMatrixInset();
23         ///
24         explicit MathMatrixInset(MathInsetTypes t);
25         ///
26         MathMatrixInset(MathInsetTypes t, int cols);
27         ///
28         MathInset * clone() const;
29         ///
30         void write(std::ostream &, bool fragile) const;
31         ///
32         void metrics(MathStyles st) const;
33         ///
34         void draw(Painter &, int x, int y) const;
35         ///
36         string label(int row) const;
37         ///
38         void label(int row, string const & label);
39         ///
40         void numbered(int row, bool num);
41         ///
42         bool numbered(int row) const;
43         ///
44         bool numberedType() const;
45         ///
46         bool display() const;
47         ///
48         bool ams() const;
49         ///
50         std::vector<string> const getLabelList() const;
51         ///
52         void validate(LaTeXFeatures & features) const;
53
54         ///
55         void addRow(int);
56         ///
57         void delRow(int);
58         ///
59         void addCol(int);
60         ///
61         void delCol(int);
62         ///
63         void appendRow();
64
65         /// change type
66         void mutate(string const &);
67         ///
68         void mutate(MathInsetTypes);
69
70         ///
71         int defaultColSpace(int col);
72         ///
73         char defaultColAlign(int col);
74
75         ///
76         MathInsetTypes getType() const;
77
78 private:
79         ///
80         void setDefaults();
81         ///
82         void setType(MathInsetTypes t);
83         ///
84         void validate1(LaTeXFeatures & features);
85         ///
86         void header_write(std::ostream &) const;
87         ///
88         void footer_write(std::ostream &) const;
89         ///
90         void glueall();
91         ///
92         string nicelabel(int row) const;
93
94         ///
95         MathInsetTypes objtype_;
96         ///
97         std::vector<int> nonum_;
98         ///
99         std::vector<string> label_;
100 };
101
102 #endif