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
16 #include "insetcollapsable.h"
17 #include "lyxlength.h"
19 /** The minipage inset
22 class InsetMinipage : public InsetCollapsable {
45 InnerPosition inner_pos;
51 void write(std::ostream & os) const;
53 void read(LyXLex & lex);
57 InsetMinipage(BufferParams const &);
59 InsetMinipage(InsetMinipage const &, bool same_id = false);
63 virtual dispatch_result localDispatch(FuncRequest const & cmd);
65 void write(Buffer const * buf, std::ostream & os) const;
67 void read(Buffer const * buf, LyXLex & lex);
69 Inset * clone(Buffer const &, bool same_id = false) const;
71 int ascent(BufferView *, LyXFont const &) const;
73 int descent(BufferView *, LyXFont const &) const;
75 Inset::Code lyxCode() const { return Inset::MINIPAGE_CODE; }
77 int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
79 string const editMessage() const;
81 bool insetAllowed(Inset::Code) const;
83 int getMaxWidth(BufferView *, UpdatableInset const *) const;
85 bool needFullRow() const { return false; }
86 /** returns true if, when outputing LaTeX, font changes should
87 be closed before generating this inset. This is needed for
88 insets that may contain several paragraphs */
89 bool noFontChange() const { return true; }
91 bool showInsetDialog(BufferView *) const;
93 int latexTextWidth(BufferView *) const;
95 void params(Params const & p) { params_ = p; }
97 Params const & params() const { return params_; }
104 #include "mailinset.h"
107 class InsetMinipageMailer : public MailInset {
110 InsetMinipageMailer(InsetMinipage & inset);
112 virtual InsetBase & inset() const { return inset_; }
114 virtual string const & name() const { return name_; }
116 virtual string const inset2string() const;
118 static void string2params(string const &, InsetMinipage::Params &);
120 static string const params2string(InsetMinipage::Params const &);
123 static string const name_;
125 InsetMinipage & inset_;