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);
30 std::string placement;
39 class InsetFloat : public InsetCollapsable {
42 InsetFloat(BufferParams const &, std::string const &);
44 InsetFloat(InsetFloat const &);
48 void write(Buffer const & buf, std::ostream & os) const;
50 void read(Buffer const & buf, LyXLex & lex);
52 void validate(LaTeXFeatures & features) const;
54 virtual std::auto_ptr<InsetBase> clone() const;
56 InsetOld::Code lyxCode() const { return InsetOld::FLOAT_CODE; }
58 int latex(Buffer const &, std::ostream &,
59 LatexRunParams const &) const;
61 int linuxdoc(Buffer const &, std::ostream &,
62 LatexRunParams const &) const;
64 int docbook(Buffer const &, std::ostream &,
65 LatexRunParams const &) const;
67 std::string const editMessage() const;
69 bool insetAllowed(InsetOld::Code) const;
70 /** returns true if, when outputing LaTeX, font changes should
71 be closed before generating this inset. This is needed for
72 insets that may contain several paragraphs */
73 bool noFontChange() const { return true; }
75 void wide(bool w, BufferParams const &);
77 void addToToc(lyx::toc::TocList &, Buffer const &) const;
79 bool showInsetDialog(BufferView *) const;
81 InsetFloatParams const & params() const { return params_; }
85 priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
88 InsetFloatParams params_;
92 #include "mailinset.h"
95 class InsetFloatMailer : public MailInset {
98 InsetFloatMailer(InsetFloat & inset);
100 virtual InsetBase & inset() const { return inset_; }
102 virtual std::string const & name() const { return name_; }
104 virtual std::string const inset2string(Buffer const &) const;
106 static void string2params(std::string const &, InsetFloatParams &);
108 static std::string const params2string(InsetFloatParams const &);
111 static std::string const name_;