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 /// Is there a parbox?
36 /// Is there a makebox?
38 /// Do we have an inner parbox or minipage to format paragraphs to
43 /// "special" widths, see usrguide.dvi ยง3.5
54 std::string height_special;
59 ///////////////////////////////////////////////////////////////////////
61 // The fbox/fancybox inset
63 ///////////////////////////////////////////////////////////////////////
66 class InsetBox : public InsetCollapsable
81 InsetBox(Buffer *, std::string const &);
84 static std::string params2string(InsetBoxParams const &);
86 static void string2params(std::string const &, InsetBoxParams &);
88 InsetBoxParams const & params() const { return params_; }
90 /// \name Public functions inherited from Inset class
93 InsetCode lyxCode() const { return BOX_CODE; }
95 docstring layoutName() const;
97 void write(std::ostream &) const;
99 void read(Lexer & lex);
101 void metrics(MetricsInfo &, Dimension &) const;
103 DisplayType display() const { return Inline; }
105 ColorCode backgroundColor(PainterInfo const &) const;
107 bool allowParagraphCustomization(idx_type = 0) const { return !forcePlainLayout(); }
109 bool forcePlainLayout(idx_type = 0) const;
111 bool neverIndent() const { return true; }
113 bool inheritFont() const { return false; }
115 void latex(otexstream &, OutputParams const &) const;
117 int plaintext(odocstringstream & ods, OutputParams const & op,
118 size_t max_length = INT_MAX) const;
120 int docbook(odocstream &, OutputParams const &) const;
122 docstring xhtml(XHTMLStream &, OutputParams const &) const;
124 void validate(LaTeXFeatures &) const;
126 bool hasFixedWidth() const;
128 std::string contextMenuName() const;
131 /// \name Public functions inherited from InsetCollapsable class
134 void setButtonLabel();
138 /// \name Protected functions inherited from Inset class
141 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
143 void doDispatch(Cursor & cur, FuncRequest & cmd);
145 Inset * clone() const { return new InsetBox(*this); }
149 /// used by the constructors
153 friend class InsetBoxParams;
154 InsetBoxParams params_;