]> git.lyx.org Git - lyx.git/blob - src/mathed/math_matrixinset.h
gcc 3.0 fixes
[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_grid.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
19 class LaTeXFeatures;
20
21 class MathMatrixInset : public MathGridInset {
22 public: 
23         ///
24         MathMatrixInset();
25         ///
26         explicit MathMatrixInset(MathInsetTypes t);
27         ///
28         MathInset *  Clone() const;
29         ///
30         void Write(std::ostream &, bool fragile) const;
31         ///
32         void Metrics(MathStyles st);
33         ///
34         void breakLine();
35         ///
36         void draw(Painter &, int, int);
37         ///
38         string label(int row) const;
39         ///
40         void label(int row, string const & label);
41         ///
42         void numbered(int row, bool num);
43         ///
44         bool numbered(int 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);
55
56         ///
57         void addRow(int);
58         ///
59         void delRow(int);
60         ///
61         void addCol(int);
62         ///
63         void delCol(int);
64         ///
65         void appendRow();
66
67         /// change type
68         void mutate(string const &);
69         ///
70         void mutate(short);
71
72         /// Splits cells and shifts right part to the next cell
73         void splitCell(int idx);
74         
75 private:
76         ///
77         void Validate1(LaTeXFeatures & features);
78         ///
79         void header_write(std::ostream &) const;
80         ///
81         void footer_write(std::ostream &) const;
82         ///
83         void glueall();
84         ///
85         string nicelabel(int row) const;
86
87         ///
88         std::vector<int> nonum_;
89         ///
90         std::vector<string> label_;
91 };
92
93 #endif