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
11 * Full author contact details are available in file CREDITS.
17 #include "InsetCollapsible.h"
19 #include "support/Length.h"
28 explicit InsetBoxParams(std::string const &);
30 void write(std::ostream & os) const;
32 void read(Lexer & lex);
36 /// Is there a parbox?
38 /// Is there a makebox?
40 /// Do we have an inner parbox or minipage to format paragraphs to
45 /// "special" widths, see usrguide.dvi §3.5
56 std::string height_special;
64 std::string framecolor;
66 std::string backgroundcolor;
71 ///////////////////////////////////////////////////////////////////////
73 // The fbox/fancybox inset
75 ///////////////////////////////////////////////////////////////////////
78 class InsetBox : public InsetCollapsible
93 InsetBox(Buffer *, std::string const &);
96 static std::string params2string(InsetBoxParams const &);
98 static void string2params(std::string const &, InsetBoxParams &);
100 InsetBoxParams const & params() const { return params_; }
102 /// \name Public functions inherited from Inset class
105 InsetCode lyxCode() const override { return BOX_CODE; }
107 docstring layoutName() const override;
109 void write(std::ostream &) const override;
111 void read(Lexer & lex) override;
113 void metrics(MetricsInfo &, Dimension &) const override;
115 ColorCode backgroundColor(PainterInfo const &) const override;
117 LyXAlignment contentAlignment() const override;
119 bool allowParagraphCustomization(idx_type = 0) const override { return !forcePlainLayout(); }
121 bool allowMultiPar() const override;
123 bool forcePlainLayout(idx_type = 0) const override;
125 bool needsCProtection(bool const maintext = false,
126 bool const fragile = false) const override;
128 bool neverIndent() const override { return true; }
130 bool inheritFont() const override { return false; }
132 void latex(otexstream &, OutputParams const &) const override;
134 int plaintext(odocstringstream & ods, OutputParams const & op,
135 size_t max_length = INT_MAX) const override;
137 void docbook(XMLStream &, OutputParams const &) const override;
139 docstring xhtml(XMLStream &, OutputParams const &) const override;
141 void validate(LaTeXFeatures &) const override;
143 bool hasFixedWidth() const override;
145 std::string contextMenuName() const override;
148 /// \name Public functions inherited from InsetCollapsible class
151 void setButtonLabel() override;
155 /// \name Protected functions inherited from Inset class
158 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override;
160 void doDispatch(Cursor & cur, FuncRequest & cmd) override;
162 Inset * clone() const override { return new InsetBox(*this); }
166 /// used by the constructors
170 friend class InsetBoxParams;
171 InsetBoxParams params_;