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(std::ostream & os) const;
56 void read(Lexer & lex);
58 void validate(LaTeXFeatures & features) const;
60 InsetCode lyxCode() const { return FLOAT_CODE; }
62 bool isMacroScope() const { return true; }
64 int latex(odocstream &, OutputParams const &) const;
66 int plaintext(odocstream &, OutputParams const &) const;
68 int docbook(odocstream &, OutputParams const &) const;
70 docstring editMessage() const;
72 bool insetAllowed(InsetCode) const;
73 /** returns true if, when outputing LaTeX, font changes should
74 be closed before generating this inset. This is needed for
75 insets that may contain several paragraphs */
76 bool noFontChange() const { return true; }
78 void wide(bool w, BufferParams const &);
80 void sideways(bool s, BufferParams const &);
82 bool showInsetDialog(BufferView *) const;
84 InsetFloatParams const & params() const { return params_; }
86 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
87 // Update the counters of this inset and of its contents
88 void updateLabels(ParIterator const &);
90 virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
93 virtual Inset * clone() const;
95 InsetFloatParams params_;
101 class InsetFloatMailer : public MailInset {
104 InsetFloatMailer(InsetFloat & inset);
106 virtual Inset & inset() const { return inset_; }
108 virtual std::string const & name() const { return name_; }
110 virtual std::string const inset2string(Buffer const &) const;
112 static void string2params(std::string const &, InsetFloatParams &);
114 static std::string const params2string(InsetFloatParams const &);
117 static std::string const name_;