]> git.lyx.org Git - lyx.git/blob - src/mathed/math_matrixinset.h
more mathml stuff
[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, col_type cols);
27         ///
28         MathInset * clone() const;
29         ///
30         void write(MathWriteInfo & os) const;
31         ///
32         void writeNormal(std::ostream &) const;
33         ///
34         void metrics(MathMetricsInfo const & st) const;
35         ///
36         void draw(Painter &, int x, int y) const;
37         ///
38         string label(row_type row) const;
39         ///
40         void label(row_type row, string const & label);
41         ///
42         void numbered(row_type row, bool num);
43         ///
44         bool numbered(row_type row) const;
45         ///
46         bool numberedType() const;
47         ///
48         bool display() const;
49         ///
50         bool ams() const;
51         ///
52         std::vector<string> const getLabelList() const;
53         ///
54         void validate(LaTeXFeatures & features) const;
55         /// identifies MatrixInsets
56         virtual MathMatrixInset const * asMatrixInset() const { return this; }
57         /// identifies MatrixInsets
58         virtual MathMatrixInset * asMatrixInset() { return this; }
59
60         ///
61         void addRow(row_type);
62         ///
63         void delRow(row_type);
64         ///
65         void addCol(col_type);
66         ///
67         void delCol(col_type);
68         ///
69         void appendRow();
70
71         /// change type
72         void mutate(string const &);
73         ///
74         void mutate(MathInsetTypes);
75
76         ///
77         int defaultColSpace(col_type col);
78         ///
79         char defaultColAlign(col_type col);
80
81         ///
82         MathInsetTypes getType() const;
83         ///
84         void mathmlize(MathMLStream &) const;
85
86 private:
87         ///
88         void setType(MathInsetTypes t);
89         ///
90         void validate1(LaTeXFeatures & features);
91         ///
92         void header_write(std::ostream &) const;
93         ///
94         void footer_write(std::ostream &) const;
95         ///
96         void glueall();
97         ///
98         string nicelabel(row_type row) const;
99
100         ///
101         MathInsetTypes objtype_;
102         ///
103         std::vector<int> nonum_;
104         ///
105         std::vector<string> label_;
106         ///
107         mutable MathMetricsInfo mi_;
108 };
109
110 #endif