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 &);
46 void write(Buffer const & buf, std::ostream & os) const;
48 void read(Buffer const & buf, LyXLex & lex);
50 void validate(LaTeXFeatures & features) const;
52 virtual std::auto_ptr<InsetBase> clone() const;
54 InsetOld::Code lyxCode() const { return InsetOld::FLOAT_CODE; }
56 int latex(Buffer const &, std::ostream &,
57 OutputParams const &) const;
59 int linuxdoc(Buffer const &, std::ostream &,
60 OutputParams const &) const;
62 int docbook(Buffer const &, std::ostream &,
63 OutputParams const &) const;
65 std::string const editMessage() const;
67 bool insetAllowed(InsetOld::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(lyx::toc::TocList &, Buffer const &) const;
77 bool showInsetDialog(BufferView *) const;
79 InsetFloatParams const & params() const { return params_; }
83 priv_dispatch(LCursor & cur, FuncRequest const & cmd);
86 InsetFloatParams params_;
90 #include "mailinset.h"
93 class InsetFloatMailer : public MailInset {
96 InsetFloatMailer(InsetFloat & inset);
98 virtual InsetBase & inset() const { return inset_; }
100 virtual std::string const & name() const { return name_; }
102 virtual std::string const inset2string(Buffer const &) const;
104 static void string2params(std::string const &, InsetFloatParams &);
106 static std::string const params2string(InsetFloatParams const &);
109 static std::string const name_;