]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_hullinset.h
mathed uglyfication
[lyx.git] / src / mathed / math_hullinset.h
index 6f234e7d0d4fee5e31ad2be3d5d0f5b59d20c29e..2c19c15b747b39a2ff166902125f7c155704a51a 100644 (file)
@@ -1,43 +1,45 @@
 // -*- C++ -*-
+/**
+ * \file math_hullinset.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
 #ifndef MATH_HULLINSET_H
 #define MATH_HULLINSET_H
 
 #include "math_gridinset.h"
 
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-/** This provides an interface between "LyX insets" and "LyX math insets"
- *  \author André Pönitz
- */
 
 class LaTeXFeatures;
 
+/// This provides an interface between "LyX insets" and "LyX math insets"
 class MathHullInset : public MathGridInset {
 public:
        ///
        MathHullInset();
        ///
-       explicit MathHullInset(MathInsetTypes t);
-       ///
-       MathHullInset(MathInsetTypes t, MathGridInset const & grid);
+       explicit MathHullInset(std::string const & type);
        ///
-       MathHullInset(MathInsetTypes t, col_type cols);
+       virtual std::auto_ptr<InsetBase> clone() const;
        ///
-       MathInset * clone() const;
+       mode_type currentMode() const;
        ///
-       void metrics(MathMetricsInfo const & st) const;
+       void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
-       void draw(Painter &, int x, int y) const;
+       void draw(PainterInfo &, int x, int y) const;
        ///
-       //void metricsT(TextMetricsInfo const & st) const;
+       void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
        ///
-       //void drawT(TextPainter &, int x, int y) const;
+       void drawT(TextPainter &, int x, int y) const;
        ///
-       string label(row_type row) const;
+       std::string label(row_type row) const;
        ///
-       void label(row_type row, string const & label);
+       void label(row_type row, std::string const & label);
        ///
        void numbered(row_type row, bool num);
        ///
@@ -48,8 +50,9 @@ public:
        bool display() const;
        ///
        bool ams() const;
-       ///
-       std::vector<string> const getLabelList() const;
+       /// Appends \c list with all labels found within this inset.
+       void getLabelList(Buffer const &,
+                         std::vector<std::string> & list) const;
        ///
        void validate(LaTeXFeatures & features) const;
        /// identifies MatrixInsets
@@ -57,39 +60,53 @@ public:
        /// identifies HullInset
        MathHullInset * asHullInset() { return this; }
 
-       ///
-       void addRow(row_type);
-       ///
-       void delRow(row_type);
-       ///
-       void addCol(col_type);
-       ///
-       void delCol(col_type);
-       ///
-       void appendRow();
+       /// add a row
+       void addRow(row_type row);
+       /// delete a row
+       void delRow(row_type row);
+       ///
+       void swapRow(row_type row);
+       /// add a column
+       void addCol(col_type col);
+       /// delete a column
+       void delCol(col_type col);
 
+       /// get type
+       std::string const & getType() const;
        /// change type
-       void mutate(string const &);
-       ///
-       void mutate(MathInsetTypes);
+       void mutate(std::string const &);
 
        ///
        int defaultColSpace(col_type col);
        ///
        char defaultColAlign(col_type col);
+       ///
+       bool idxFirst(BufferView &) const;
+       ///
+       bool idxLast(BufferView &) const;
 
        ///
-       MathInsetTypes getType() const;
+       std::string fileInsetLabel() const;
        ///
        void write(WriteStream & os) const;
        ///
        void mathmlize(MathMLStream &) const;
        ///
        void normalize(NormalStream &) const;
+       ///
+       void infoize(std::ostream & os) const;
+
+protected:
+       ///
+       virtual
+       DispatchResult
+       priv_dispatch(BufferView & bv, FuncRequest const & cmd);
+       ///
+       std::string eolString(row_type row, bool fragile) const;
 
 private:
        ///
-       void setType(MathInsetTypes t);
+       void setType(std::string const & type);
        ///
        void validate1(LaTeXFeatures & features);
        ///
@@ -97,20 +114,24 @@ private:
        ///
        void footer_write(WriteStream &) const;
        ///
+       std::string nicelabel(row_type row) const;
+       ///
+       void doExtern(FuncRequest const & func, BufferView &);
+       ///
        void glueall();
        ///
-       string nicelabel(row_type row) const;
+       char const * standardFont() const;
        /// consistency check
        void check() const;
+       /// can this change its number of cols?
+       bool colChangeOK() const;
 
-       ///
-       MathInsetTypes objtype_;
+       /// "none", "simple", "display", "eqnarray",...
+       std::string type_;
        ///
        std::vector<int> nonum_;
        ///
-       std::vector<string> label_;
-       ///
-       mutable MathMetricsInfo mi_;
+       std::vector<std::string> label_;
 };
 
 #endif