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 bool isMacroScope() const { return true; }
66 int latex(odocstream &, OutputParams const &) const;
68 int plaintext(odocstream &, OutputParams const &) const;
70 int docbook(odocstream &, OutputParams const &) const;
72 docstring editMessage() const;
74 bool insetAllowed(InsetCode) const;
75 /** returns true if, when outputing LaTeX, font changes should
76 be closed before generating this inset. This is needed for
77 insets that may contain several paragraphs */
78 bool noFontChange() const { return true; }
80 void wide(bool w, BufferParams const &);
82 void sideways(bool s, BufferParams const &);
84 void subfloat(bool s, BufferParams const &);
86 bool showInsetDialog(BufferView *) const;
88 InsetFloatParams const & params() const { return params_; }
90 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
91 // Update the counters of this inset and of its contents
92 void updateLabels(ParIterator const &);
94 virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
97 virtual Inset * clone() const;
99 docstring getCaption(OutputParams const &) const;
101 InsetFloatParams params_;
107 class InsetFloatMailer : public MailInset {
110 InsetFloatMailer(InsetFloat & inset);
112 virtual Inset & inset() const { return inset_; }
114 virtual std::string const & name() const { return name_; }
116 virtual std::string const inset2string(Buffer const &) const;
118 static void string2params(std::string const &, InsetFloatParams &);
120 static std::string const params2string(InsetFloatParams const &);
123 static std::string const name_;