]> git.lyx.org Git - lyx.git/blob - src/mathed/math_matrixinset.h
LyX Drinkers Union: patch 1
[lyx.git] / src / mathed / math_matrixinset.h
1 // -*- C++ -*-
2 #ifndef MATH_MATRIXINSET_H
3 #define MATH_MATRIXINSET_H
4
5 #include "math_grid.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         MathInset *  Clone() const;
27         ///
28         void Write(std::ostream &, bool fragile) const;
29         ///
30         void Metrics(MathStyles st);
31         ///
32         void breakLine();
33         ///
34         void draw(Painter &, int, int);
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         vector<string> const getLabelList() const;
51         ///
52         void Validate(LaTeXFeatures & features);
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(short);
69
70         /// Splits cells and shifts right part to the next cell
71         void splitCell(int idx);
72         
73 private:
74         ///
75         void Validate1(LaTeXFeatures & features);
76         ///
77         void header_write(std::ostream &) const;
78         ///
79         void footer_write(std::ostream &) const;
80         ///
81         void glueall();
82         ///
83         string nicelabel(int row) const;
84
85         ///
86         std::vector<int> nonum_;
87         ///
88         std::vector<string> label_;
89 };
90
91 #endif