3 * \file insetminipage.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
8 * \author Lars Gullik Bjønnes
10 * Full author contact details are available in file CREDITS
13 #ifndef InsetMinipage_H
14 #define InsetMinipage_H
17 #include "insetcollapsable.h"
18 #include "lyxlength.h"
20 /** The minipage inset
23 class InsetMinipage : public InsetCollapsable {
46 InnerPosition inner_pos;
52 void write(std::ostream & os) const;
54 void read(LyXLex & lex);
58 InsetMinipage(BufferParams const &);
60 InsetMinipage(InsetMinipage const &, bool same_id = false);
64 virtual dispatch_result localDispatch(FuncRequest const & cmd);
66 void write(Buffer const * buf, std::ostream & os) const;
68 void read(Buffer const * buf, LyXLex & lex);
70 Inset * clone(Buffer const &, bool same_id = false) const;
72 int ascent(BufferView *, LyXFont const &) const;
74 int descent(BufferView *, LyXFont const &) const;
76 Inset::Code lyxCode() const { return Inset::MINIPAGE_CODE; }
78 int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
80 string const editMessage() const;
82 bool insetAllowed(Inset::Code) const;
88 InnerPosition innerPos() const;
90 void innerPos(InnerPosition);
92 LyXLength const & pageHeight() const;
94 void pageHeight(LyXLength const &);
96 LyXLength const & pageWidth() const;
98 void pageWidth(LyXLength const &);
100 int getMaxWidth(BufferView *, UpdatableInset const *) const;
102 bool needFullRow() const { return false; }
103 /** returns true if, when outputing LaTeX, font changes should
104 be closed before generating this inset. This is needed for
105 insets that may contain several paragraphs */
106 bool noFontChange() const { return true; }
108 bool showInsetDialog(BufferView *) const;
110 int latexTextWidth(BufferView *) const;
112 void params(Params const & p) { params_ = p; }
114 Params const & params() const { return params_; }
121 #include "mailinset.h"
124 class InsetMinipageMailer : public MailInset {
127 InsetMinipageMailer(InsetMinipage & inset);
129 virtual Inset & inset() const { return inset_; }
131 virtual string const & name() const { return name_; }
133 virtual string const inset2string() const;
135 static void string2params(string const &, InsetMinipage::Params &);
137 static string const params2string(InsetMinipage::Params const &);
140 static string const name_;
142 InsetMinipage & inset_;