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 class InsetBoxParams {
24 InsetBoxParams(std::string const &);
26 void write(std::ostream & os) const;
28 void read(LyXLex & lex);
31 /// Use a parbox (true) or minipage (false)
33 /// Do we have an inner parbox or minipage to format paragraphs to
38 /// "special" widths, see usrguide.dvi ยง3.5
49 std::string height_special;
53 /** The fbox/fancybox inset
56 class InsetBox : public InsetCollapsable {
59 InsetBox(BufferParams const &, std::string const &);
63 std::string const editMessage() const;
65 InsetBase::Code lyxCode() const { return InsetBase::BOX_CODE; }
67 void write(Buffer const &, std::ostream &) const;
69 void read(Buffer const & buf, LyXLex & lex);
71 void setButtonLabel();
73 void metrics(MetricsInfo &, Dimension &) const;
74 /// show the Box dialog
75 bool showInsetDialog(BufferView * bv) const;
77 bool display() const { return false; }
79 int latex(Buffer const &, std::ostream &,
80 OutputParams const &) const;
82 int linuxdoc(Buffer const &, std::ostream &,
83 OutputParams const &) const;
85 int docbook(Buffer const &, std::ostream &,
86 OutputParams const &) const;
88 int plaintext(Buffer const &, std::ostream &,
89 OutputParams const & runparams) const;
91 void validate(LaTeXFeatures &) const;
93 InsetBoxParams const & params() const { return params_; }
95 bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
106 InsetBox(InsetBox const &);
107 virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
109 friend class InsetBoxParams;
111 virtual std::auto_ptr<InsetBase> doClone() const;
113 /// used by the constructors
116 InsetBoxParams params_;
120 #include "mailinset.h"
122 class InsetBoxMailer : public MailInset {
125 InsetBoxMailer(InsetBox & inset);
127 virtual InsetBase & inset() const { return inset_; }
129 virtual std::string const & name() const { return name_; }
131 virtual std::string const inset2string(Buffer const &) const;
133 static std::string const params2string(InsetBoxParams const &);
135 static void string2params(std::string const &, InsetBoxParams &);
139 static std::string const name_;
144 #endif // INSET_BOX_H