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), subfloat(false) {}
28 void write(std::ostream & os) const;
30 void read(Lexer & lex);
34 std::string placement;
47 class InsetFloat : public InsetCollapsable {
50 InsetFloat(Buffer const &, std::string const &);
54 docstring name() const { return name_; }
56 void write(std::ostream & os) const;
58 void read(Lexer & lex);
60 void validate(LaTeXFeatures & features) const;
62 InsetCode lyxCode() const { return FLOAT_CODE; }
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 void subfloat(bool s, BufferParams const &);
84 bool showInsetDialog(BufferView *) const;
86 InsetFloatParams const & params() const { return params_; }
89 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
90 // Update the counters of this inset and of its contents
91 void updateLabels(ParIterator const &);
93 void doDispatch(Cursor & cur, FuncRequest & cmd);
95 Inset * clone() const { return new InsetFloat(*this); }
97 docstring getCaption(OutputParams const &) const;
99 InsetFloatParams params_;
105 class InsetFloatMailer : public MailInset {
108 InsetFloatMailer(InsetFloat & inset);
110 virtual Inset & inset() const { return inset_; }
112 virtual std::string const & name() const { return name_; }
114 virtual std::string const inset2string(Buffer const &) const;
116 static void string2params(std::string const &, InsetFloatParams &);
118 static std::string const params2string(InsetFloatParams const &);
121 static std::string const name_;