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"
18 #include "MailInset.h"
23 class InsetBoxParams {
26 InsetBoxParams(std::string const &);
28 void write(std::ostream & os) const;
30 void read(Lexer & lex);
33 /// Use a parbox (true) or minipage (false)
35 /// Do we have an inner parbox or minipage to format paragraphs to
40 /// "special" widths, see usrguide.dvi ยง3.5
51 std::string height_special;
55 /** The fbox/fancybox inset
58 class InsetBox : public InsetCollapsable {
72 InsetBox(Buffer const &, std::string const &);
77 friend class InsetBoxParams;
78 friend class InsetBoxMailer;
80 docstring editMessage() const;
82 InsetCode lyxCode() const { return BOX_CODE; }
84 docstring name() const;
86 void write(std::ostream &) const;
88 void read(Lexer & lex);
90 void setButtonLabel();
92 void metrics(MetricsInfo &, Dimension &) const;
93 /// show the Box dialog
94 bool showInsetDialog(BufferView * bv) const;
96 DisplayType display() const { return Inline; }
97 //FIXME Is this the one we want? or is it:
98 //allowParagraphCustomization(idx_type)?
100 bool forceEmptyLayout() const;
102 bool neverIndent() const { return true; }
104 bool noFontChange() const { return true; }
106 bool isMacroScope() const;
108 int latex(odocstream &, OutputParams const &) const;
110 int plaintext(odocstream &, OutputParams const &) const;
112 int docbook(odocstream &, OutputParams const &) const;
114 void validate(LaTeXFeatures &) const;
116 InsetBoxParams const & params() const { return params_; }
118 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
120 void doDispatch(Cursor & cur, FuncRequest & cmd);
121 /// Is the width forced to some value?
122 bool hasFixedWidth() const;
124 Inset * clone() const { return new InsetBox(*this); }
125 /// used by the constructors
129 InsetBoxParams params_;
133 class InsetBoxMailer : public MailInset {
136 InsetBoxMailer(InsetBox & inset);
138 virtual Inset & inset() const { return inset_; }
140 virtual std::string const & name() const { return name_; }
142 virtual std::string const inset2string(Buffer const &) const;
144 static std::string const params2string(InsetBoxParams const &);
146 static void string2params(std::string const &, InsetBoxParams &);
150 static std::string const name_;
158 #endif // INSET_BOX_H