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 &, LatexRunParams 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 void wide(bool w, BufferParams const &);
75 void addToToc(toc::TocList &, Buffer const *) const;
77 bool showInsetDialog(BufferView *) const;
79 InsetFloatParams const & params() const { return params_; }
83 InsetFloatParams params_;
87 #include "mailinset.h"
90 class InsetFloatMailer : public MailInset {
93 InsetFloatMailer(InsetFloat & inset);
95 virtual InsetBase & inset() const { return inset_; }
97 virtual string const & name() const { return name_; }
99 virtual string const inset2string() const;
101 static void string2params(string const &, InsetFloatParams &);
103 static string const params2string(InsetFloatParams const &);
106 static string const name_;