4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
8 * \author Martin Vermeer
10 * Full author contact details are available in file CREDITS.
16 #include "InsetCollapsable.h"
26 InsetBoxParams(std::string const &);
28 void write(std::ostream & os) const;
30 void read(Lexer & lex);
34 /// Use a parbox (true) or minipage (false)
36 /// Do we have an inner parbox or minipage to format paragraphs to
41 /// "special" widths, see usrguide.dvi ยง3.5
52 std::string height_special;
57 ///////////////////////////////////////////////////////////////////////
59 // The fbox/fancybox inset
61 ///////////////////////////////////////////////////////////////////////
64 class InsetBox : public InsetCollapsable
79 InsetBox(Buffer const &, std::string const &);
83 static std::string params2string(InsetBoxParams const &);
85 static void string2params(std::string const &, InsetBoxParams &);
88 friend class InsetBoxParams;
90 InsetCode lyxCode() const { return BOX_CODE; }
92 docstring name() const;
94 void write(std::ostream &) const;
96 void read(Lexer & lex);
98 void setButtonLabel();
100 void metrics(MetricsInfo &, Dimension &) const;
101 /// show the Box dialog
102 bool showInsetDialog(BufferView * bv) const;
104 DisplayType display() const { return Inline; }
106 bool allowParagraphCustomization(idx_type = 0) const { return !forcePlainLayout(); }
108 bool forcePlainLayout(idx_type = 0) const;
110 bool neverIndent() const { return true; }
112 bool noFontChange() const { return true; }
114 int latex(odocstream &, OutputParams const &) const;
116 int plaintext(odocstream &, OutputParams const &) const;
118 int docbook(odocstream &, OutputParams const &) const;
120 docstring xhtml(odocstream &, OutputParams const &) const;
122 void validate(LaTeXFeatures &) const;
124 InsetBoxParams const & params() const { return params_; }
126 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
128 void doDispatch(Cursor & cur, FuncRequest & cmd);
129 /// Is the width forced to some value?
130 bool hasFixedWidth() const;
132 Inset * clone() const { return new InsetBox(*this); }
133 /// used by the constructors
136 docstring contextMenu(BufferView const & bv, int x, int y) const;
139 InsetBoxParams params_;