]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathStream.h
Cmake export tests: Added sublabel handling also to revertedTests
[lyx.git] / src / mathed / MathStream.h
index 7da9a9b9f9177d0949a6a1c71f4ac8e0b3d750ba..6cfd5855ec5be625e063275804080466a506236a 100644 (file)
@@ -17,6 +17,7 @@
 #include "InsetMath.h"
 // FIXME: Move to individual insets
 #include "MetricsInfo.h"
+#include "texstream.h"
 
 
 namespace lyx {
@@ -39,10 +40,10 @@ public:
                wsPreview
        };
        ///
-       WriteStream(odocstream & os, bool fragile, bool latex, OutputType output,
-               Encoding const * encoding = 0);
+       WriteStream(otexrowstream & os, bool fragile, bool latex, OutputType output,
+                               Encoding const * encoding = 0);
        ///
-       explicit WriteStream(odocstream & os);
+       explicit WriteStream(otexrowstream & os);
        ///
        ~WriteStream();
        ///
@@ -54,7 +55,9 @@ public:
        ///
        OutputType output() const { return output_; }
        ///
-       odocstream & os() { return os_; }
+       otexrowstream & os() { return os_; }
+       ///
+       TexRow & texrow() { return os_.texrow(); }
        ///
        bool & firstitem() { return firstitem_; }
        ///
@@ -85,9 +88,18 @@ public:
        bool asciiOnly() const { return ascii_; }
        /// LaTeX encoding
        Encoding const * encoding() const { return encoding_; }
+
+       /// maintains a stack of texrow informations about outer math insets.
+       /// push an entry
+       void pushRowEntry(TexRow::RowEntry entry);
+       /// pop an entry
+       void popRowEntry();
+       /// TexRow::starts the innermost outer math inset
+       /// returns true if the outer row entry will appear at this line
+       bool startOuterRow();
 private:
        ///
-       odocstream & os_;
+       otexrowstream & os_;
        /// do we have to write \\protect sometimes
        bool fragile_;
        /// are we at the beginning of an MathData?
@@ -112,6 +124,8 @@ private:
        int line_;
        ///
        Encoding const * encoding_;
+       ///
+       std::vector<TexRow::RowEntry> outer_row_entries_;
 };
 
 ///
@@ -299,9 +313,7 @@ public:
        bool inText() const { return in_text_; }
 private:
        ///
-       void setTextMode() { in_text_ = true; }
-       ///
-       void setMathMode() { in_text_ = false; }
+       void setTextMode(bool t) { in_text_ = t; }
        ///
        odocstream & os_;
        ///
@@ -335,30 +347,16 @@ MathStream & operator<<(MathStream &, ETag const &);
 
 
 /// A simpler version of ModeSpecifier, for MathML
-// FIXME There are still problems here with nesting, at least
-// potentially. The problem is that true nesting of text mode isn't
-// actually possible. I.e., we can't have: 
-//             <mtext><mtext></mtext></mtext>
-// So we have to have:
-//             <mtext></mtext><mtext></mtext><mtext></mtext>
-// instead, where the last is really a continuation of the first.
-// We'll need some kind of stack to remember all that.
 class SetMode {
 public:
-       ///
-       explicit SetMode(MathStream & os, bool text, std::string const & attrs);
        ///
        explicit SetMode(MathStream & os, bool text);
        ///
        ~SetMode();
 private:
-       ///
-       void init(bool, std::string const &);
        ///
        MathStream & os_;
        ///
-       bool opened_;
-       ///
        bool was_text_;
 };
 
@@ -387,9 +385,7 @@ public:
        bool inText() const { return in_text_; }
 private:
        ///
-       void setTextMode() { in_text_ = true; }
-       ///
-       void setMathMode() { in_text_ = false; }
+       void setTextMode(bool t) { in_text_ = t; }
        ///
        odocstream & os_;
        ///
@@ -424,20 +420,14 @@ HtmlStream & operator<<(HtmlStream &, ETag const &);
 
 class SetHTMLMode {
 public:
-       ///
-       explicit SetHTMLMode(HtmlStream & os, bool text, std::string attrs);
        ///
        explicit SetHTMLMode(HtmlStream & os, bool text);
        ///
        ~SetHTMLMode();
 private:
-       ///
-       void init(bool, std::string const &);
        ///
        HtmlStream & os_;
        ///
-       bool opened_;
-       ///
        bool was_text_;
 };