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"
18 #include "mailinset.h"
24 class InsetFloatParams {
27 InsetFloatParams() : wide(false), sideways(false) {}
29 void write(std::ostream & os) const;
31 void read(LyXLex & lex);
35 std::string placement;
46 class InsetFloat : public InsetCollapsable {
49 InsetFloat(BufferParams const &, std::string const &);
53 void write(Buffer const & buf, std::ostream & os) const;
55 void read(Buffer const & buf, LyXLex & lex);
57 void validate(LaTeXFeatures & features) const;
59 InsetBase::Code lyxCode() const { return InsetBase::FLOAT_CODE; }
61 int latex(Buffer const &, odocstream &,
62 OutputParams const &) const;
64 int docbook(Buffer const &, odocstream &,
65 OutputParams const &) const;
67 virtual docstring const editMessage() const;
69 bool insetAllowed(InsetBase::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 sideways(bool s, BufferParams const &);
79 void addToToc(toc::TocList &, Buffer const &) const;
81 bool showInsetDialog(BufferView *) const;
83 InsetFloatParams const & params() const { return params_; }
85 bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
87 virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
89 virtual std::auto_ptr<InsetBase> doClone() const;
92 InsetFloatParams params_;
96 class InsetFloatMailer : public MailInset {
99 InsetFloatMailer(InsetFloat & inset);
101 virtual InsetBase & inset() const { return inset_; }
103 virtual std::string const & name() const { return name_; }
105 virtual std::string const inset2string(Buffer const &) const;
107 static void string2params(std::string const &, InsetFloatParams &);
109 static std::string const params2string(InsetFloatParams const &);
112 static std::string const name_;