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.
17 #include "insetcollapsable.h"
18 #include "lyxlength.h"
21 struct InsetBoxParams {
23 InsetBoxParams(std::string const &);
25 void write(std::ostream & os) const;
27 void read(LyXLex & lex);
30 /// Use a parbox (true) or minipage (false)
32 /// Do we have an inner parbox or minipage to format paragraphs to
37 /// "special" widths, see usrguide.dvi ยง3.5
48 std::string height_special;
52 /** The fbox/fancybox inset
55 class InsetBox : public InsetCollapsable {
58 InsetBox(BufferParams const &, std::string const &);
60 InsetBox(InsetBox const &);
64 virtual std::auto_ptr<InsetBase> clone() const;
66 std::string const editMessage() const;
68 InsetOld::Code lyxCode() const { return InsetOld::BOX_CODE; }
70 void write(Buffer const &, std::ostream &) const;
72 void read(Buffer const & buf, LyXLex & lex);
74 void setButtonLabel();
76 void metrics(MetricsInfo &, Dimension &) const;
77 /// show the Box dialog
78 bool showInsetDialog(BufferView * bv) const;
80 bool display() const { return false; }
82 int latex(Buffer const &, std::ostream &,
83 OutputParams const &) const;
85 int linuxdoc(Buffer const &, std::ostream &,
86 OutputParams const &) const;
88 int docbook(Buffer const &, std::ostream &,
89 OutputParams const &) const;
91 int plaintext(Buffer const &, std::ostream &,
92 OutputParams const & runparams) const;
94 void validate(LaTeXFeatures &) const;
96 InsetBoxParams const & params() const { return params_; }
110 priv_dispatch(LCursor & cur, FuncRequest const & cmd);
112 friend class InsetBoxParams;
114 /// used by the constructors
117 InsetBoxParams params_;
121 #include "mailinset.h"
123 class InsetBoxMailer : public MailInset {
126 InsetBoxMailer(InsetBox & inset);
128 virtual InsetBase & inset() const { return inset_; }
130 virtual std::string const & name() const { return name_; }
132 virtual std::string const inset2string(Buffer const &) const;
134 static std::string const params2string(InsetBoxParams const &);
136 static void string2params(std::string const &, InsetBoxParams &);
140 static std::string const name_;
145 #endif // INSET_BOX_H