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 {
61 InsetBox(BufferParams const &, std::string const &);
65 virtual docstring const editMessage() const;
67 InsetCode lyxCode() const { return BOX_CODE; }
69 docstring name() const;
71 void write(Buffer const &, std::ostream &) const;
73 void read(Buffer const & buf, Lexer & lex);
75 void setButtonLabel();
77 void metrics(MetricsInfo &, Dimension &) const;
78 /// show the Box dialog
79 bool showInsetDialog(BufferView * bv) const;
81 DisplayType display() const { return Inline; }
83 bool forceDefaultParagraphs(idx_type) const;
85 bool neverIndent(Buffer const &) const { return true; }
87 bool noFontChange() const { return true; }
89 bool isMacroScope(Buffer const & buf) const;
91 int latex(Buffer const &, odocstream &, OutputParams const &) const;
93 int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
95 int docbook(Buffer const &, odocstream &, OutputParams const &) const;
97 void validate(LaTeXFeatures &) const;
99 InsetBoxParams const & params() const { return params_; }
101 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
114 InsetBox(InsetBox const &);
115 virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
116 /// Is the width forced to some value?
117 virtual bool hasFixedWidth() const;
119 friend class InsetBoxParams;
121 virtual Inset * clone() const;
123 /// used by the constructors
126 InsetBoxParams params_;
130 class InsetBoxMailer : public MailInset {
133 InsetBoxMailer(InsetBox & inset);
135 virtual Inset & inset() const { return inset_; }
137 virtual std::string const & name() const { return name_; }
139 virtual std::string const inset2string(Buffer const &) const;
141 static std::string const params2string(InsetBoxParams const &);
143 static void string2params(std::string const &, InsetBoxParams &);
147 static std::string const name_;
155 #endif // INSET_BOX_H