]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathBox.h
Coding style
[lyx.git] / src / mathed / InsetMathBox.h
index fc8d9aa977a93b2d8a4d1f18c7f8e832ef644106..7138f25dce0c4b247df6290471e230df6ed7ca7c 100644 (file)
 #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