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
17 #include "insetcollapsable.h"
22 struct InsetFloatParams {
24 InsetFloatParams() : placement("htbp"), wide(false) {}
26 void write(std::ostream & os) const;
28 void read(LyXLex & lex);
41 class InsetFloat : public InsetCollapsable {
44 InsetFloat(BufferParams const &, string const &);
46 InsetFloat(InsetFloat const &, bool same_id = false);
51 virtual dispatch_result localDispatch(FuncRequest const & cmd);
54 void write(Buffer const * buf, std::ostream & os) const;
56 void read(Buffer const * buf, LyXLex & lex);
58 void validate(LaTeXFeatures & features) const;
60 Inset * clone(Buffer const &, bool same_id = false) const;
62 Inset::Code lyxCode() const { return Inset::FLOAT_CODE; }
64 int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
66 int docbook(Buffer const *, std::ostream &, bool mixcont) const;
68 string const editMessage() const;
70 bool insetAllowed(Inset::Code) const;
71 /** returns true if, when outputing LaTeX, font changes should
72 be closed before generating this inset. This is needed for
73 insets that may contain several paragraphs */
74 bool noFontChange() const { return true; }
76 string const & type() const;
78 void placement(string const & p);
80 string const & placement() const;
82 void wide(bool w, BufferParams const &);
86 void addToToc(toc::TocList &, Buffer const *) const;
88 bool showInsetDialog(BufferView *) const;
90 InsetFloatParams const & params() const { return params_; }
94 InsetFloatParams params_;
98 #include "mailinset.h"
101 class InsetFloatMailer : public MailInset {
104 InsetFloatMailer(InsetFloat & inset);
106 virtual Inset & inset() const { return inset_; }
108 virtual string const & name() const { return name_; }
110 virtual string const inset2string() const;
112 static void string2params(string const &, InsetFloatParams &);
114 static string const params2string(string const & name,
115 InsetFloatParams const &);