]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathBox.h
Fix bug 5802 (http://bugzilla.lyx.org/show_bug.cgi?id=5802)
[lyx.git] / src / mathed / InsetMathBox.h
index fc8d9aa977a93b2d8a4d1f18c7f8e832ef644106..d5c269cfecc85a55587ebeda793cd644909416d9 100644 (file)
@@ -4,7 +4,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author André Pönitz
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
 #include <string>
 
 
-class LyXFont;
+namespace lyx {
 
 /// Support for \\mbox
-
 class InsetMathBox : public InsetMathNest {
 public:
        ///
-       explicit InsetMathBox(std::string const & name);
+       explicit InsetMathBox(docstring const & name);
        ///
        mode_type currentMode() const { return TEXT_MODE; }
        ///
@@ -36,13 +35,87 @@ public:
        ///
        void normalize(NormalStream & ns) const;
        ///
-       void infoize(std::ostream & os) const;
+       void infoize(odocstream & os) const;
+       ///
+       void validate(LaTeXFeatures & features) const;
 
 private:
-       virtual std::auto_ptr<InsetBase> doClone() const;
+       Inset * clone() const { return new InsetMathBox(*this); }
        ///
-       std::string name_;
+       docstring name_;
 };
 
 
-#endif
+/// Non-AMS-style frame
+class InsetMathFBox : public InsetMathNest {
+public:
+       ///
+       InsetMathFBox();
+       ///
+       mode_type currentMode() const { return TEXT_MODE; }
+       ///
+       void metrics(MetricsInfo & mi, Dimension & dim) const;
+       ///
+       void draw(PainterInfo & pi, int x, int y) const;
+       ///
+       void write(WriteStream & os) const;
+       /// write normalized content
+       void normalize(NormalStream & ns) const;
+       ///
+       void infoize(odocstream & os) const;
+private:
+       ///
+       Inset * clone() const { return new InsetMathFBox(*this); }
+};
+
+
+/// Extra nesting: \\makebox or \\framebox.
+class InsetMathMakebox : public InsetMathNest {
+public:
+       ///
+       InsetMathMakebox(bool framebox);
+       ///
+       void metrics(MetricsInfo & mi, Dimension & dim) const;
+       ///
+       void draw(PainterInfo & pi, int x, int y) const;
+       ///
+       void write(WriteStream & os) const;
+       /// write normalized content
+       void normalize(NormalStream & ns) const;
+       ///
+       mode_type currentMode() const { return TEXT_MODE; }
+       ///
+       void infoize(odocstream & os) const;
+private:
+       Inset * clone() const { return new InsetMathMakebox(*this); }
+       ///
+       bool framebox_;
+};
+
+
+
+/// AMS-style frame
+class InsetMathBoxed : public InsetMathNest {
+public:
+       ///
+       InsetMathBoxed();
+       ///
+       void validate(LaTeXFeatures & features) const;
+       ///
+       void metrics(MetricsInfo & mi, Dimension & dim) const;
+       ///
+       void draw(PainterInfo & pi, int x, int y) const;
+       ///
+       void write(WriteStream & os) const;
+       /// write normalized content
+       void normalize(NormalStream & ns) const;
+       ///
+       void infoize(odocstream & os) const;
+private:
+       Inset * clone() const { return new InsetMathBoxed(*this); }
+};
+
+
+} // namespace lyx
+
+#endif // MATH_MBOX