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"
21 class InsetFloatParams {
24 InsetFloatParams() : wide(false), sideways(false), subfloat(false) {}
26 void write(std::ostream & os) const;
28 void read(Lexer & lex);
32 std::string placement;
43 /////////////////////////////////////////////////////////////////////////
47 /////////////////////////////////////////////////////////////////////////
49 /// Used for "floating" objects like tables, figures etc.
50 class InsetFloat : public InsetCollapsable
54 InsetFloat(Buffer * buffer, std::string params_str);
57 static void string2params(std::string const &, InsetFloatParams &);
59 static std::string params2string(InsetFloatParams const &);
61 void setWide(bool w, bool update_label = true);
63 void setSideways(bool s, bool update_label = true);
65 void setSubfloat(bool s, bool update_label = true);
69 InsetFloatParams const & params() const { return params_; }
72 docstring name() const;
74 docstring toolTip(BufferView const & bv, int x, int y) const;
76 void write(std::ostream & os) const;
78 void read(Lexer & lex);
80 void validate(LaTeXFeatures & features) const;
82 InsetCode lyxCode() const { return FLOAT_CODE; }
84 int latex(odocstream &, OutputParams const &) const;
86 int plaintext(odocstream &, OutputParams const &) const;
88 int docbook(odocstream &, OutputParams const &) const;
90 docstring xhtml(XHTMLStream &, OutputParams const &) const;
92 bool insetAllowed(InsetCode) const;
93 /** returns true if, when outputing LaTeX, font changes should
94 be closed before generating this inset. This is needed for
95 insets that may contain several paragraphs */
96 bool noFontChange() const { return true; }
98 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
99 // Update the counters of this inset and of its contents
100 void updateLabels(ParIterator const &, UpdateType);
102 void doDispatch(Cursor & cur, FuncRequest & cmd);
104 Inset * clone() const { return new InsetFloat(*this); }
106 docstring getCaption(OutputParams const &) const;
108 InsetFloatParams params_;
114 #endif // INSET_FLOAT_H