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"
17 #include "mailinset.h"
23 class InsetFloatParams {
26 InsetFloatParams() : wide(false), sideways(false) {}
28 void write(std::ostream & os) const;
30 void read(LyXLex & lex);
34 std::string placement;
45 class InsetFloat : public InsetCollapsable {
48 InsetFloat(BufferParams const &, std::string const &);
52 void write(Buffer const & buf, std::ostream & os) const;
54 void read(Buffer const & buf, LyXLex & lex);
56 void validate(LaTeXFeatures & features) const;
58 InsetBase::Code lyxCode() const { return InsetBase::FLOAT_CODE; }
60 virtual bool wide() const { return false; }
62 int latex(Buffer const &, odocstream &,
63 OutputParams const &) const;
65 int docbook(Buffer const &, odocstream &,
66 OutputParams const &) const;
68 virtual docstring const editMessage() const;
70 bool insetAllowed(InsetBase::Code) const;
71 /** returns true if, when outputing LaTeX, font changes should
72 be closed before generating this inset. This is needed for
73 insets that may contain several paragraphs */
74 bool noFontChange() const { return true; }
76 void wide(bool w, BufferParams const &);
78 void sideways(bool s, BufferParams const &);
80 void addToToc(TocList &, Buffer const &) const;
82 bool showInsetDialog(BufferView *) const;
84 InsetFloatParams const & params() const { return params_; }
86 bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
88 virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
90 virtual std::auto_ptr<InsetBase> doClone() const;
93 InsetFloatParams params_;
97 class InsetFloatMailer : public MailInset {
100 InsetFloatMailer(InsetFloat & inset);
102 virtual InsetBase & inset() const { return inset_; }
104 virtual std::string const & name() const { return name_; }
106 virtual std::string const inset2string(Buffer const &) const;
108 static void string2params(std::string const &, InsetFloatParams &);
110 static std::string const params2string(InsetFloatParams const &);
113 static std::string const name_;