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
16 #include "insetcollapsable.h"
20 struct InsetFloatParams {
22 InsetFloatParams() : wide(false) {}
24 void write(std::ostream & os) const;
26 void read(LyXLex & lex);
39 class InsetFloat : public InsetCollapsable {
42 InsetFloat(BufferParams const &, string const &);
44 InsetFloat(InsetFloat const &, bool same_id = false);
48 virtual dispatch_result localDispatch(FuncRequest const & cmd);
50 void write(Buffer const * buf, std::ostream & os) const;
52 void read(Buffer const * buf, LyXLex & lex);
54 void validate(LaTeXFeatures & features) const;
56 Inset * clone(Buffer const &, bool same_id = false) const;
58 Inset::Code lyxCode() const { return Inset::FLOAT_CODE; }
60 int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
62 int docbook(Buffer const *, std::ostream &, bool mixcont) const;
64 string const editMessage() const;
66 bool insetAllowed(Inset::Code) const;
67 /** returns true if, when outputing LaTeX, font changes should
68 be closed before generating this inset. This is needed for
69 insets that may contain several paragraphs */
70 bool noFontChange() const { return true; }
72 void wide(bool w, BufferParams const &);
74 void addToToc(toc::TocList &, Buffer const *) const;
76 bool showInsetDialog(BufferView *) const;
78 InsetFloatParams const & params() const { return params_; }
82 InsetFloatParams params_;
86 #include "mailinset.h"
89 class InsetFloatMailer : public MailInset {
92 InsetFloatMailer(InsetFloat & inset);
94 virtual InsetBase & inset() const { return inset_; }
96 virtual string const & name() const { return name_; }
98 virtual string const inset2string() const;
100 static void string2params(string const &, InsetFloatParams &);
102 static string const params2string(InsetFloatParams const &);
105 static string const name_;