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 class InsetFloatParams {
23 InsetFloatParams() : wide(false), sideways(false) {}
25 void write(std::ostream & os) const;
27 void read(LyXLex & lex);
31 std::string placement;
42 class InsetFloat : public InsetCollapsable {
45 InsetFloat(BufferParams const &, std::string const &);
49 void write(Buffer const & buf, std::ostream & os) const;
51 void read(Buffer const & buf, LyXLex & lex);
53 void validate(LaTeXFeatures & features) const;
55 InsetBase::Code lyxCode() const { return InsetBase::FLOAT_CODE; }
57 int latex(Buffer const &, std::ostream &,
58 OutputParams const &) const;
60 int docbook(Buffer const &, std::ostream &,
61 OutputParams const &) const;
63 virtual lyx::docstring const editMessage() const;
65 bool insetAllowed(InsetBase::Code) const;
66 /** returns true if, when outputing LaTeX, font changes should
67 be closed before generating this inset. This is needed for
68 insets that may contain several paragraphs */
69 bool noFontChange() const { return true; }
71 void wide(bool w, BufferParams const &);
73 void sideways(bool s, BufferParams const &);
75 void addToToc(lyx::toc::TocList &, Buffer const &) const;
77 bool showInsetDialog(BufferView *) const;
79 InsetFloatParams const & params() const { return params_; }
81 bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
83 virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
85 virtual std::auto_ptr<InsetBase> doClone() const;
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_;