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"
19 #include "support/translator.h"
22 struct 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 &);
61 InsetBox(InsetBox const &);
65 virtual std::auto_ptr<InsetBase> clone() const;
67 std::string const editMessage() const;
69 InsetOld::Code lyxCode() const { return InsetOld::BOX_CODE; }
71 void write(Buffer const &, std::ostream &) const;
73 void read(Buffer const & buf, LyXLex & lex);
75 void setButtonLabel();
77 void metrics(MetricsInfo &, Dimension &) const;
78 /// show the Box dialog
79 bool showInsetDialog(BufferView * bv) const;
81 int latex(Buffer const &, std::ostream &,
82 OutputParams const &) const;
84 int linuxdoc(Buffer const &, std::ostream &,
85 OutputParams const &) const;
87 int docbook(Buffer const &, std::ostream &,
88 OutputParams const &) const;
90 int plaintext(Buffer const &, std::ostream &,
91 OutputParams const & runparams) const;
93 void validate(LaTeXFeatures &) const;
95 InsetBoxParams const & params() const { return params_; }
109 priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
111 friend class InsetBoxParams;
113 /// used by the constructors
116 InsetBoxParams params_;
122 typedef Translator<std::string, InsetBox::BoxType> BoxTranslator;
123 BoxTranslator const & boxtranslator();
124 BoxTranslator const & boxtranslator_loc();
129 #include "mailinset.h"
131 class InsetBoxMailer : public MailInset {
134 InsetBoxMailer(InsetBox & inset);
136 virtual InsetBase & inset() const { return inset_; }
138 virtual std::string const & name() const { return name_; }
140 virtual std::string const inset2string(Buffer const &) const;
142 static std::string const params2string(InsetBoxParams const &);
144 static void string2params(std::string const &, InsetBoxParams &);
148 static std::string const name_;
153 #endif // INSET_BOX_H