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"
17 #include "lyxlength.h"
18 #include "mailinset.h"
23 class InsetBoxParams {
26 InsetBoxParams(std::string const &);
28 void write(std::ostream & os) const;
30 void read(LyXLex & 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 {
61 InsetBox(BufferParams const &, std::string const &);
65 virtual docstring const editMessage() const;
67 InsetBase::Code lyxCode() const { return InsetBase::BOX_CODE; }
69 void write(Buffer const &, std::ostream &) const;
71 void read(Buffer const & buf, LyXLex & lex);
73 void setButtonLabel();
75 void metrics(MetricsInfo &, Dimension &) const;
76 /// show the Box dialog
77 bool showInsetDialog(BufferView * bv) const;
79 bool display() const { return false; }
81 bool forceDefaultParagraphs(idx_type) const;
83 bool neverIndent(Buffer const &) const { return true; }
85 bool noFontChange() const { return true; }
87 int latex(Buffer const &, odocstream &, OutputParams const &) const;
89 int docbook(Buffer const &, odocstream &, OutputParams const &) const;
91 int plaintext(Buffer const &, odocstream &,
92 OutputParams const & runparams) const;
94 void validate(LaTeXFeatures &) const;
96 InsetBoxParams const & params() const { return params_; }
98 bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
109 InsetBox(InsetBox const &);
110 virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
112 friend class InsetBoxParams;
114 virtual std::auto_ptr<InsetBase> doClone() const;
116 /// used by the constructors
119 InsetBoxParams params_;
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_;
148 #endif // INSET_BOX_H