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 { return BOX_CODE; }
107 docstring layoutName() const;
109 void write(std::ostream &) const;
111 void read(Lexer & lex);
113 void metrics(MetricsInfo &, Dimension &) const;
115 ColorCode backgroundColor(PainterInfo const &) const;
117 LyXAlignment contentAlignment() const;
119 bool allowParagraphCustomization(idx_type = 0) const { return !forcePlainLayout(); }
121 bool allowMultiPar() const;
123 bool forcePlainLayout(idx_type = 0) const;
125 bool needsCProtection(bool const maintext = false,
126 bool const fragile = false) const;
128 bool neverIndent() const { return true; }
130 bool inheritFont() const { return false; }
132 void latex(otexstream &, OutputParams const &) const;
134 int plaintext(odocstringstream & ods, OutputParams const & op,
135 size_t max_length = INT_MAX) const;
137 void docbook(XMLStream &, OutputParams const &) const;
139 docstring xhtml(XMLStream &, OutputParams const &) const;
141 void validate(LaTeXFeatures &) const;
143 bool hasFixedWidth() const;
145 std::string contextMenuName() const;
148 /// \name Public functions inherited from InsetCollapsible class
151 void setButtonLabel();
155 /// \name Protected functions inherited from Inset class
158 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
160 void doDispatch(Cursor & cur, FuncRequest & cmd);
162 Inset * clone() const { return new InsetBox(*this); }
166 /// used by the constructors
170 friend class InsetBoxParams;
171 InsetBoxParams params_;