]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathFrac.h
Improve the list of equations
[lyx.git] / src / mathed / InsetMathFrac.h
index b2c55666b216835edfe4a2c44f0f25debc8169ee..9d5484487687932368f8bd45dc2be588cd4f47c1 100644 (file)
@@ -23,13 +23,17 @@ namespace lyx {
 class InsetMathFracBase : public InsetMathNest {
 public:
        ///
-       explicit InsetMathFracBase(idx_type ncells = 2);
+       InsetMathFracBase(Buffer * buf, idx_type ncells = 2);
        ///
        bool idxUpDown(Cursor &, bool up) const;
        ///
        bool idxBackward(Cursor &) const { return false; }
        ///
        bool idxForward(Cursor &) const { return false; }
+       ///
+       InsetMathFracBase * asFracBaseInset() { return this; }
+       ///
+       InsetMathFracBase const * asFracBaseInset() const { return this; }
 };
 
 
@@ -52,12 +56,14 @@ public:
                UNIT
        };
        ///
-       explicit InsetMathFrac(Kind kind = FRAC, idx_type ncells = 2);
+       explicit InsetMathFrac(Buffer * buf, Kind kind = FRAC, idx_type ncells = 2);
        ///
        bool idxForward(Cursor &) const;
        ///
        bool idxBackward(Cursor &) const;
        ///
+       MathClass mathClass() const;
+       ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
        void draw(PainterInfo &, int x, int y) const;
@@ -84,8 +90,13 @@ public:
        ///
        void mathmlize(MathStream &) const;
        ///
+       void htmlize(HtmlStream &) const;
+       ///
        void validate(LaTeXFeatures & features) const;
-public:
+private:
+       /// vertical displacement
+       int dy(FontInfo & fi) const;
+       ///
        Inset * clone() const;
        ///
        Kind kind_;
@@ -106,11 +117,13 @@ public:
                BRACK
        };
        ///
-       explicit InsetMathBinom(Kind kind = BINOM);
+       explicit InsetMathBinom(Buffer * buf, Kind kind = BINOM);
        ///
        void write(WriteStream & os) const;
        ///
        void normalize(NormalStream &) const;
+       /// Generalized fractions are of inner class (see The TeXbook, p.292)
+       MathClass mathClass() const { return MC_INNER; }
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
@@ -123,7 +136,11 @@ public:
        ///
        void mathmlize(MathStream &) const;
        ///
+       void htmlize(HtmlStream &) const;
+       ///
        void validate(LaTeXFeatures & features) const;
+       ///
+       InsetCode lyxCode() const { return MATH_FRAC_CODE; }
 private:
        Inset * clone() const;
        ///