]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBox.h
Fix GRAPHICS_EDIT of InsetGraphics
[lyx.git] / src / insets / InsetBox.h
index d905fa049d596697f83db636b434b3deedd831f9..4f207c28a832dbcb370ab9bc3afb1f932081285c 100644 (file)
@@ -14,7 +14,7 @@
 #define INSETBOX_H
 
 #include "InsetCollapsable.h"
-#include "LyXLength.h"
+#include "Length.h"
 #include "MailInset.h"
 
 
@@ -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;
 };
@@ -58,37 +58,57 @@ public:
 class InsetBox : public InsetCollapsable {
 public:
        ///
-       InsetBox(BufferParams const &, std::string const &);
+       enum BoxType {
+               Frameless,
+               Boxed,
+               Framed,
+               ovalbox,
+               Ovalbox,
+               Shadowbox,
+               Shaded,
+               Doublebox
+       };
+       ///
+       InsetBox(Buffer const &, std::string const &);
        ///
        ~InsetBox();
+private:
+       ///
+       friend class InsetBoxParams;
+       friend class InsetBoxMailer;
        ///
-       virtual docstring const editMessage() const;
+       docstring editMessage() const;
        ///
-       InsetBase::Code lyxCode() const { return InsetBase::BOX_CODE; }
+       InsetCode lyxCode() const { return BOX_CODE; }
        ///
-       void write(Buffer const &, std::ostream &) const;
+       docstring name() const;
        ///
-       void read(Buffer const & buf, Lexer & lex);
+       void write(std::ostream &) const;
+       ///
+       void read(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; }
+       ///
+       virtual bool allowParagraphCustomization(idx_type = 0)
+               { return forceEmptyLayout(); }
        ///
-       bool forceDefaultParagraphs(idx_type) const;
+       virtual bool forceEmptyLayout(idx_type = 0) const;
        ///
-       bool neverIndent(Buffer const &) const { return true; }
+       bool neverIndent() const { return true; }
        ///
        bool noFontChange() const { return true; }
        ///
-       int latex(Buffer const &, odocstream &, OutputParams const &) const;
+       int latex(odocstream &, OutputParams const &) const;
        ///
-       int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
+       int plaintext(odocstream &, OutputParams const &) const;
        ///
-       int docbook(Buffer const &, odocstream &, OutputParams const &) const;
+       int docbook(odocstream &, OutputParams const &) const;
        ///
        void validate(LaTeXFeatures &) const;
        ///
@@ -96,26 +116,14 @@ public:
        ///
        bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
        ///
-       enum BoxType {
-               Frameless,
-               Boxed,
-               ovalbox,
-               Ovalbox,
-               Shadowbox,
-               Doublebox
-       };
-protected:
-       InsetBox(InsetBox const &);
-       virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
+       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;
-
+       bool hasFixedWidth() const;
+       ///
+       Inset * clone() const { return new InsetBox(*this); }
        /// used by the constructors
        void init();
+
        ///
        InsetBoxParams params_;
 };
@@ -126,7 +134,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_; }
        ///