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"
27 explicit InsetBoxParams(std::string const &);
29 void write(std::ostream & os) const;
31 void read(Lexer & lex);
35 /// Is there a parbox?
37 /// Is there a makebox?
39 /// Do we have an inner parbox or minipage to format paragraphs to
44 /// "special" widths, see usrguide.dvi §3.5
55 std::string height_special;
63 std::string framecolor;
65 std::string backgroundcolor;
70 ///////////////////////////////////////////////////////////////////////
72 // The fbox/fancybox inset
74 ///////////////////////////////////////////////////////////////////////
77 class InsetBox : public InsetCollapsible
92 InsetBox(Buffer *, std::string const &);
95 static std::string params2string(InsetBoxParams const &);
97 static void string2params(std::string const &, InsetBoxParams &);
99 InsetBoxParams const & params() const { return params_; }
101 /// \name Public functions inherited from Inset class
104 InsetCode lyxCode() const { return BOX_CODE; }
106 docstring layoutName() const;
108 void write(std::ostream &) const;
110 void read(Lexer & lex);
112 void metrics(MetricsInfo &, Dimension &) const;
114 ColorCode backgroundColor(PainterInfo const &) const;
116 LyXAlignment contentAlignment() const;
118 bool allowParagraphCustomization(idx_type = 0) const { return !forcePlainLayout(); }
120 bool allowMultiPar() const;
122 bool forcePlainLayout(idx_type = 0) const;
124 bool needsCProtection(bool const maintext = false,
125 bool const fragile = false) const;
127 bool neverIndent() const { return true; }
129 bool inheritFont() const { return false; }
131 void latex(otexstream &, OutputParams const &) const;
133 int plaintext(odocstringstream & ods, OutputParams const & op,
134 size_t max_length = INT_MAX) const;
136 void docbook(XMLStream &, OutputParams const &) const;
138 docstring xhtml(XMLStream &, OutputParams const &) const;
140 void validate(LaTeXFeatures &) const;
142 bool hasFixedWidth() const;
144 std::string contextMenuName() const;
147 /// \name Public functions inherited from InsetCollapsible class
150 void setButtonLabel();
154 /// \name Protected functions inherited from Inset class
157 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
159 void doDispatch(Cursor & cur, FuncRequest & cmd);
161 Inset * clone() const { return new InsetBox(*this); }
165 /// used by the constructors
169 friend class InsetBoxParams;
170 InsetBoxParams params_;