]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_matrixinset.h
further code uglification to make Jean-Marc's compiler happy
[lyx.git] / src / mathed / math_matrixinset.h
index 8561d72a3b5dd6ebb17468087281c692da0732cf..823eab9bbd8175d403e32ad9adac33ef9147f86e 100644 (file)
@@ -2,9 +2,7 @@
 #ifndef MATH_MATRIXINSET_H
 #define MATH_MATRIXINSET_H
 
-#include <vector>
-
-#include "math_parinset.h"
+#include "math_gridinset.h"
 
 #ifdef __GNUG__
 #pragma interface
     like array and eqnarray.
     \author Alejandro Aguilar Sierra
 */
-class MathMatrixInset : public MathParInset {
+
+class LaTeXFeatures;
+
+class MathMatrixInset : public MathGridInset {
 public: 
        ///
-       explicit
-       MathMatrixInset(int m, int n, short st = LM_ST_TEXT);
+       MathMatrixInset();
        ///
-       explicit
-       MathMatrixInset(MathMatrixInset const &);
+       explicit MathMatrixInset(MathInsetTypes t);
        ///
-       ~MathMatrixInset();
+       MathMatrixInset(MathInsetTypes t, unsigned int cols);
        ///
-       MathedInset * Clone();
+       MathInset * clone() const;
        ///
-       void draw(Painter &, int, int);
+       void write(std::ostream &, bool fragile) const;
        ///
-       void Write(std::ostream &, bool fragile);
+       void metrics(MathStyles st) const;
        ///
-       void Metrics();
+       void draw(Painter &, int x, int y) const;
        ///
-       void setData(MathedArray const &);
+       string label(unsigned int row) const;
        ///
-       void SetAlign(char, string const &);
+       void label(unsigned int row, string const & label);
        ///
-       int GetColumns() const;
+       void numbered(unsigned int row, bool num);
        ///
-       int GetRows() const;
+       bool numbered(unsigned int row) const;
        ///
-       virtual bool isMatrix() const;
-       
-       /// Use this to manage the extra information independently of paragraph
-       MathedRowContainer & getRowSt();
-private:
-       ///  Number of columns & rows
-       int nc_;
-       ///
-       int nr_;
-       /// tab sizes
-       std::vector<int> ws_;   
-       /// 
-       char v_align_; // add approp. type
-       ///
-       //std::vector<char> h_align;
-       string h_align_; // a vector would perhaps be more correct
-       /// Vertical structure
-       MathedRowContainer row_;
-};
+       bool numberedType() const;
+       ///
+       bool display() const;
+       ///
+       bool ams() const;
+       ///
+       std::vector<string> const getLabelList() const;
+       ///
+       void validate(LaTeXFeatures & features) const;
 
+       ///
+       void addRow(unsigned int);
+       ///
+       void delRow(unsigned int);
+       ///
+       void addCol(unsigned int);
+       ///
+       void delCol(unsigned int);
+       ///
+       void appendRow();
 
-inline
-int MathMatrixInset::GetColumns() const
-{
-       return nc_;
-}
+       /// change type
+       void mutate(string const &);
+       ///
+       void mutate(MathInsetTypes);
 
+       ///
+       int defaultColSpace(unsigned int col);
+       ///
+       char defaultColAlign(unsigned int col);
 
-inline
-int MathMatrixInset::GetRows() const
-{
-       return nr_;
-}
+       ///
+       MathInsetTypes getType() const;
 
+private:
+       ///
+       void setType(MathInsetTypes t);
+       ///
+       void validate1(LaTeXFeatures & features);
+       ///
+       void header_write(std::ostream &) const;
+       ///
+       void footer_write(std::ostream &) const;
+       ///
+       void glueall();
+       ///
+       string nicelabel(unsigned int row) const;
 
-inline
-bool MathMatrixInset::isMatrix() const
-{
-       return true;
-}
-       
+       ///
+       MathInsetTypes objtype_;
+       ///
+       std::vector<int> nonum_;
+       ///
+       std::vector<string> label_;
+};
 
-inline
-MathedRowContainer & MathMatrixInset::getRowSt()
-{
-       return row_;
-}
 #endif