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 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 DisplayType display() const { return Inline; }
116 ColorCode backgroundColor(PainterInfo const &) const;
118 LyXAlignment contentAlignment() const;
120 bool allowParagraphCustomization(idx_type = 0) const { return !forcePlainLayout(); }
122 bool allowMultiPar() const;
124 bool forcePlainLayout(idx_type = 0) const;
126 bool neverIndent() const { return true; }
128 bool inheritFont() const { return false; }
130 void latex(otexstream &, OutputParams const &) const;
132 int plaintext(odocstringstream & ods, OutputParams const & op,
133 size_t max_length = INT_MAX) const;
135 int docbook(odocstream &, OutputParams const &) const;
137 docstring xhtml(XHTMLStream &, OutputParams const &) const;
139 void validate(LaTeXFeatures &) const;
141 bool hasFixedWidth() const;
143 std::string contextMenuName() const;
146 /// \name Public functions inherited from InsetCollapsible class
149 void setButtonLabel();
153 /// \name Protected functions inherited from Inset class
156 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
158 void doDispatch(Cursor & cur, FuncRequest & cmd);
160 Inset * clone() const { return new InsetBox(*this); }
164 /// used by the constructors
168 friend class InsetBoxParams;
169 InsetBoxParams params_;