]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetBox.h
* Lazy MathData to avoid unneeded interpretation of macro definitions
[features.git] / src / insets / InsetBox.h
index 5c10dfad77562262a12072fa7ba9a95d74f4d619..3ae2c6946e5a06aa892c0f43d697822d91013e2b 100644 (file)
@@ -14,7 +14,7 @@
 #define INSETBOX_H
 
 #include "InsetCollapsable.h"
-#include "LyXLength.h"
+#include "Length.h"
 #include "MailInset.h"
 
 
@@ -27,7 +27,7 @@ public:
        ///
        void write(std::ostream & os) const;
        ///
-       void read(LyXLex & lex);
+       void read(Lexer & lex);
        ///
        std::string type;
        /// Use a parbox (true) or minipage (false)
@@ -36,7 +36,7 @@ public:
        /// columnwidth?
        bool inner_box;
        ///
-       LyXLength width;
+       Length width;
        /// "special" widths, see usrguide.dvi ยง3.5
        std::string special;
        ///
@@ -46,7 +46,7 @@ public:
        ///
        char inner_pos;
        ///
-       LyXLength height;
+       Length height;
        ///
        std::string height_special;
 };
@@ -64,19 +64,21 @@ public:
        ///
        virtual docstring const editMessage() const;
        ///
-       InsetBase::Code lyxCode() const { return InsetBase::BOX_CODE; }
+       InsetCode lyxCode() const { return BOX_CODE; }
+       ///
+       docstring name() const;
        ///
        void write(Buffer const &, std::ostream &) const;
        ///
-       void read(Buffer const & buf, LyXLex & lex);
+       void read(Buffer const & buf, Lexer & lex);
        ///
        void setButtonLabel();
        ///
-       bool metrics(MetricsInfo &, Dimension &) const;
+       void metrics(MetricsInfo &, Dimension &) const;
        /// show the Box dialog
        bool showInsetDialog(BufferView * bv) const;
        ///
-       bool display() const { return false; }
+       DisplayType display() const { return Inline; }
        ///
        bool forceDefaultParagraphs(idx_type) const;
        ///
@@ -84,6 +86,8 @@ public:
        ///
        bool noFontChange() const { return true; }
        ///
+       bool isMacroScope(Buffer const & buf) const;
+       ///
        int latex(Buffer const &, odocstream &, OutputParams const &) const;
        ///
        int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
@@ -94,25 +98,27 @@ public:
        ///
        InsetBoxParams const & params() const { return params_; }
        ///
-       bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
+       bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
        ///
        enum BoxType {
                Frameless,
                Boxed,
+               Framed,
                ovalbox,
                Ovalbox,
                Shadowbox,
+               Shaded,
                Doublebox
        };
 protected:
        InsetBox(InsetBox const &);
-       virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
+       virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
        /// Is the width forced to some value?
        virtual bool hasFixedWidth() const;
 private:
        friend class InsetBoxParams;
 
-       virtual std::auto_ptr<InsetBase> doClone() const;
+       virtual Inset * clone() const;
 
        /// used by the constructors
        void init();
@@ -126,7 +132,7 @@ public:
        ///
        InsetBoxMailer(InsetBox & inset);
        ///
-       virtual InsetBase & inset() const { return inset_; }
+       virtual Inset & inset() const { return inset_; }
        ///
        virtual std::string const & name() const { return name_; }
        ///