X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetBox.h;h=83ba43403e07129dd5270eb6446a85970aa820f6;hb=996505c2ae981187d34580633fca410972c2493d;hp=d65268f82795a00ecf6c56edef9c56a3e4c2e7a8;hpb=2640b2122838b7025b8494fb378b8927fca75831;p=lyx.git diff --git a/src/insets/InsetBox.h b/src/insets/InsetBox.h index d65268f827..83ba43403e 100644 --- a/src/insets/InsetBox.h +++ b/src/insets/InsetBox.h @@ -15,12 +15,12 @@ #include "InsetCollapsable.h" #include "Length.h" -#include "MailInset.h" namespace lyx { -class InsetBoxParams { +class InsetBoxParams +{ public: /// InsetBoxParams(std::string const &); @@ -28,6 +28,7 @@ public: void write(std::ostream & os) const; /// void read(Lexer & lex); + /// std::string type; /// Use a parbox (true) or minipage (false) @@ -37,7 +38,7 @@ public: bool inner_box; /// Length width; - /// "special" widths, see usrguide.dvi §3.5 + /// "special" widths, see usrguide.dvi §3.5 std::string special; /// char pos; @@ -52,43 +53,71 @@ public: }; -/** The fbox/fancybox inset -*/ -class InsetBox : public InsetCollapsable { +/////////////////////////////////////////////////////////////////////// +// +// The fbox/fancybox inset +// +/////////////////////////////////////////////////////////////////////// + + +class InsetBox : public InsetCollapsable +{ public: /// - InsetBox(BufferParams const &, std::string const &); + enum BoxType { + Frameless, + Boxed, + Framed, + ovalbox, + Ovalbox, + Shadowbox, + Shaded, + Doublebox + }; + /// + InsetBox(Buffer *, std::string const &); /// ~InsetBox(); /// - virtual docstring const editMessage() const; + static std::string params2string(InsetBoxParams const &); /// - Inset::Code lyxCode() const { return Inset::BOX_CODE; } + static void string2params(std::string const &, InsetBoxParams &); +private: + /// + friend class InsetBoxParams; /// - void write(Buffer const &, std::ostream &) const; + InsetCode lyxCode() const { return BOX_CODE; } /// - void read(Buffer const & buf, Lexer & lex); + docstring name() const; + /// + 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; } /// - bool forceDefaultParagraphs(idx_type) const; + bool allowParagraphCustomization(idx_type = 0) const { return !forcePlainLayout(); } /// - bool neverIndent(Buffer const &) const { return true; } + bool forcePlainLayout(idx_type = 0) const; + /// + 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(odocstream &, OutputParams const &) const; /// - int plaintext(Buffer const &, odocstream &, OutputParams const &) const; + int docbook(odocstream &, OutputParams const &) const; /// - int docbook(Buffer const &, odocstream &, OutputParams const &) const; + docstring xhtml(XHTMLStream &, OutputParams const &) const; /// void validate(LaTeXFeatures &) const; /// @@ -96,56 +125,20 @@ 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; + bool hasFixedWidth() const; /// - virtual docstring name() const { return from_ascii("Box"); } -private: - friend class InsetBoxParams; - - virtual std::auto_ptr doClone() const; - + Inset * clone() const { return new InsetBox(*this); } /// used by the constructors void init(); /// - InsetBoxParams params_; -}; - - -class InsetBoxMailer : public MailInset { -public: - /// - InsetBoxMailer(InsetBox & inset); - /// - virtual Inset & inset() const { return inset_; } - /// - virtual std::string const & name() const { return name_; } - /// - virtual std::string const inset2string(Buffer const &) const; - /// - static std::string const params2string(InsetBoxParams const &); - /// - static void string2params(std::string const &, InsetBoxParams &); + docstring contextMenu(BufferView const & bv, int x, int y) const; -private: /// - static std::string const name_; - /// - InsetBox & inset_; + InsetBoxParams params_; }; - } // namespace lyx -#endif // INSET_BOX_H +#endif // INSETBOX_H