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 *, std::string const &);
59 static void string2params(std::string const &, InsetFloatParams &);
61 static std::string params2string(InsetFloatParams const &);
63 void setWide(bool w, bool update_label = true);
65 void setSideways(bool s, bool update_label = true);
67 void setSubfloat(bool s, bool update_label = true);
71 InsetFloatParams const & params() const { return params_; }
74 docstring name() const;
76 docstring toolTip(BufferView const & bv, int x, int y) const;
78 void write(std::ostream & os) const;
80 void read(Lexer & lex);
82 void validate(LaTeXFeatures & features) const;
84 InsetCode lyxCode() const { return FLOAT_CODE; }
86 int latex(odocstream &, OutputParams const &) const;
88 int plaintext(odocstream &, OutputParams const &) const;
90 int docbook(odocstream &, OutputParams const &) const;
92 docstring xhtml(XHTMLStream &, OutputParams const &) const;
94 bool insetAllowed(InsetCode) const;
95 /** returns true if, when outputing LaTeX, font changes should
96 be closed before generating this inset. This is needed for
97 insets that may contain several paragraphs */
98 bool noFontChange() const { return true; }
100 bool showInsetDialog(BufferView *) const;
102 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
103 // Update the counters of this inset and of its contents
104 void updateLabels(ParIterator const &, UpdateType);
106 void doDispatch(Cursor & cur, FuncRequest & cmd);
108 Inset * clone() const { return new InsetFloat(*this); }
110 docstring getCaption(OutputParams const &) const;
112 InsetFloatParams params_;
120 #endif // INSET_FLOAT_H