]> git.lyx.org Git - lyx.git/blob - src/mathed/math_hullinset.h
some support for matrix operations with maple ('M-x math-extern maple evalm')
[lyx.git] / src / mathed / math_hullinset.h
1 // -*- C++ -*-
2 #ifndef MATH_HULLINSET_H
3 #define MATH_HULLINSET_H
4
5 #include "math_gridinset.h"
6
7 #ifdef __GNUG__
8 #pragma interface
9 #endif
10
11 /** This provides an interface between "LyX insets" and "LyX math insets"
12  *  \author André Pönitz
13  */
14
15 class LaTeXFeatures;
16
17 class MathHullInset : public MathGridInset {
18 public: 
19         ///
20         MathHullInset();
21         ///
22         explicit MathHullInset(MathInsetTypes t);
23         ///
24         MathHullInset(MathInsetTypes t, col_type cols);
25         ///
26         MathInset * clone() const;
27         ///
28         void write(WriteStream & os) const;
29         ///
30         void normalize(NormalStream &) const;
31         ///
32         void metrics(MathMetricsInfo const & st) const;
33         ///
34         void draw(Painter &, int x, int y) const;
35         ///
36         string label(row_type row) const;
37         ///
38         void label(row_type row, string const & label);
39         ///
40         void numbered(row_type row, bool num);
41         ///
42         bool numbered(row_type 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         /// identifies MatrixInsets
54         virtual MathHullInset const * asHullInset() const { return this; }
55         /// identifies HullInset
56         virtual MathHullInset * asHullInset() { return this; }
57
58         ///
59         void addRow(row_type);
60         ///
61         void delRow(row_type);
62         ///
63         void addCol(col_type);
64         ///
65         void delCol(col_type);
66         ///
67         void appendRow();
68
69         /// change type
70         void mutate(string const &);
71         ///
72         void mutate(MathInsetTypes);
73
74         ///
75         int defaultColSpace(col_type col);
76         ///
77         char defaultColAlign(col_type col);
78
79         ///
80         MathInsetTypes getType() const;
81         ///
82         void mathmlize(MathMLStream &) const;
83
84 private:
85         ///
86         void setType(MathInsetTypes t);
87         ///
88         void validate1(LaTeXFeatures & features);
89         ///
90         void header_write(std::ostream &) const;
91         ///
92         void footer_write(std::ostream &) const;
93         ///
94         void glueall();
95         ///
96         string nicelabel(row_type row) const;
97
98         ///
99         MathInsetTypes objtype_;
100         ///
101         std::vector<int> nonum_;
102         ///
103         std::vector<string> label_;
104         ///
105         mutable MathMetricsInfo mi_;
106 };
107
108 #endif