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(Lexer & lex);
34 std::string placement;
45 class InsetFloat : public InsetCollapsable {
48 InsetFloat(BufferParams const &, std::string const &);
52 docstring name() const { return name_; }
54 void write(Buffer const & buf, std::ostream & os) const;
56 void read(Buffer const & buf, Lexer & lex);
58 void validate(LaTeXFeatures & features) const;
60 Inset::Code lyxCode() const { return Inset::FLOAT_CODE; }
62 int latex(Buffer const &, odocstream &,
63 OutputParams const &) const;
65 int plaintext(Buffer const &, odocstream &,
66 OutputParams const &) const;
68 int docbook(Buffer const &, odocstream &,
69 OutputParams const &) const;
71 virtual docstring const editMessage() const;
73 bool insetAllowed(Inset::Code) const;
74 /** returns true if, when outputing LaTeX, font changes should
75 be closed before generating this inset. This is needed for
76 insets that may contain several paragraphs */
77 bool noFontChange() const { return true; }
79 void wide(bool w, BufferParams const &);
81 void sideways(bool s, BufferParams const &);
83 bool showInsetDialog(BufferView *) const;
85 InsetFloatParams const & params() const { return params_; }
87 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
88 // Update the counters of this inset and of its contents
89 virtual void updateLabels(Buffer const &, ParIterator const &);
91 virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
94 virtual std::auto_ptr<Inset> doClone() const;
96 InsetFloatParams params_;
102 class InsetFloatMailer : public MailInset {
105 InsetFloatMailer(InsetFloat & inset);
107 virtual Inset & inset() const { return inset_; }
109 virtual std::string const & name() const { return name_; }
111 virtual std::string const inset2string(Buffer const &) const;
113 static void string2params(std::string const &, InsetFloatParams &);
115 static std::string const params2string(InsetFloatParams const &);
118 static std::string const name_;