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"
21 struct InsetFloatParams {
23 InsetFloatParams() : placement("htbp"), wide(false) {}
25 void write(std::ostream & os) const;
27 void read(LyXLex & lex);
40 class InsetFloat : public InsetCollapsable {
43 InsetFloat(BufferParams const &, string const &);
45 InsetFloat(InsetFloat const &, bool same_id = false);
49 virtual dispatch_result localDispatch(FuncRequest const & cmd);
51 void write(Buffer const * buf, std::ostream & os) const;
53 void read(Buffer const * buf, LyXLex & lex);
55 void validate(LaTeXFeatures & features) const;
57 Inset * clone(Buffer const &, bool same_id = false) const;
59 Inset::Code lyxCode() const { return Inset::FLOAT_CODE; }
61 int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
63 int docbook(Buffer const *, std::ostream &, bool mixcont) const;
65 string const editMessage() const;
67 bool insetAllowed(Inset::Code) const;
68 /** returns true if, when outputing LaTeX, font changes should
69 be closed before generating this inset. This is needed for
70 insets that may contain several paragraphs */
71 bool noFontChange() const { return true; }
73 string const & type() const;
75 void placement(string const & p);
77 string const & placement() const;
79 void wide(bool w, BufferParams const &);
83 void addToToc(toc::TocList &, Buffer const *) const;
85 bool showInsetDialog(BufferView *) const;
87 InsetFloatParams const & params() const { return params_; }
91 InsetFloatParams params_;
95 #include "mailinset.h"
98 class InsetFloatMailer : public MailInset {
101 InsetFloatMailer(InsetFloat & inset);
103 virtual Inset & inset() const { return inset_; }
105 virtual string const & name() const { return name_; }
107 virtual string const inset2string() const;
109 static void string2params(string const &, InsetFloatParams &);
111 static string const params2string(InsetFloatParams const &);
114 static string const name_;