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 InsetCode lyxCode() const { return FLOAT_CODE; }
62 bool isMacroScope(Buffer const &) const { return true; }
64 int latex(Buffer const &, odocstream &,
65 OutputParams const &) const;
67 int plaintext(Buffer const &, odocstream &,
68 OutputParams const &) const;
70 int docbook(Buffer const &, odocstream &,
71 OutputParams const &) const;
73 virtual docstring const editMessage() const;
75 bool insetAllowed(InsetCode) const;
76 /** returns true if, when outputing LaTeX, font changes should
77 be closed before generating this inset. This is needed for
78 insets that may contain several paragraphs */
79 bool noFontChange() const { return true; }
81 void wide(bool w, BufferParams const &);
83 void sideways(bool s, BufferParams const &);
85 bool showInsetDialog(BufferView *) const;
87 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 virtual void updateLabels(Buffer const &, ParIterator const &);
93 virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
96 virtual Inset * clone() const;
98 InsetFloatParams params_;
104 class InsetFloatMailer : public MailInset {
107 InsetFloatMailer(InsetFloat & inset);
109 virtual Inset & inset() const { return inset_; }
111 virtual std::string const & name() const { return name_; }
113 virtual std::string const inset2string(Buffer const &) const;
115 static void string2params(std::string const &, InsetFloatParams &);
117 static std::string const params2string(InsetFloatParams const &);
120 static std::string const name_;