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 &);
62 std::string const editMessage() const;
64 InsetBase::Code lyxCode() const { return InsetBase::BOX_CODE; }
66 void write(Buffer const &, std::ostream &) const;
68 void read(Buffer const & buf, LyXLex & lex);
70 void setButtonLabel();
72 void metrics(MetricsInfo &, Dimension &) const;
73 /// show the Box dialog
74 bool showInsetDialog(BufferView * bv) const;
76 bool display() const { return false; }
78 int latex(Buffer const &, std::ostream &,
79 OutputParams const &) const;
81 int linuxdoc(Buffer const &, std::ostream &,
82 OutputParams const &) const;
84 int docbook(Buffer const &, std::ostream &,
85 OutputParams const &) const;
87 int plaintext(Buffer const &, std::ostream &,
88 OutputParams const & runparams) const;
90 void validate(LaTeXFeatures &) const;
92 InsetBoxParams const & params() const { return params_; }
103 InsetBox(InsetBox const &);
104 virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
106 friend class InsetBoxParams;
108 virtual std::auto_ptr<InsetBase> doClone() const;
110 /// used by the constructors
113 InsetBoxParams params_;
117 #include "mailinset.h"
119 class InsetBoxMailer : public MailInset {
122 InsetBoxMailer(InsetBox & inset);
124 virtual InsetBase & inset() const { return inset_; }
126 virtual std::string const & name() const { return name_; }
128 virtual std::string const inset2string(Buffer const &) const;
130 static std::string const params2string(InsetBoxParams const &);
132 static void string2params(std::string const &, InsetBoxParams &);
136 static std::string const name_;
141 #endif // INSET_BOX_H