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"
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;
45 /////////////////////////////////////////////////////////////////////////
49 /////////////////////////////////////////////////////////////////////////
51 /// Used for "floating" objects like tables, figures etc.
52 class InsetFloat : public InsetCollapsable
56 InsetFloat(Buffer const &, std::string const &);
61 static void string2params(std::string const &, InsetFloatParams &);
63 static std::string params2string(InsetFloatParams const &);
65 void setWide(bool w, BufferParams const &, bool update_label = true);
67 void setSideways(bool s, BufferParams const &, bool update_label = true);
69 void setSubfloat(bool s, BufferParams const &, bool update_label = true);
71 void setNewLabel(BufferParams const &);
73 InsetFloatParams const & params() const { return params_; }
76 docstring name() const;
78 docstring toolTip(BufferView const & bv, int x, int y) const;
80 void write(std::ostream & os) const;
82 void read(Lexer & lex);
84 void validate(LaTeXFeatures & features) const;
86 InsetCode lyxCode() const { return FLOAT_CODE; }
88 int latex(odocstream &, OutputParams const &) const;
90 int plaintext(odocstream &, OutputParams const &) const;
92 int docbook(odocstream &, OutputParams const &) const;
94 docstring xhtml(odocstream &, OutputParams const &) const;
96 docstring editMessage() const;
98 bool insetAllowed(InsetCode) const;
99 /** returns true if, when outputing LaTeX, font changes should
100 be closed before generating this inset. This is needed for
101 insets that may contain several paragraphs */
102 bool noFontChange() const { return true; }
104 bool showInsetDialog(BufferView *) const;
106 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
107 // Update the counters of this inset and of its contents
108 void updateLabels(ParIterator const &);
110 void doDispatch(Cursor & cur, FuncRequest & cmd);
112 Inset * clone() const { return new InsetFloat(*this); }
114 docstring getCaption(OutputParams const &) const;
116 docstring getCaptionText(OutputParams const &) const;
118 docstring getCaptionHTML(OutputParams const &) const;
120 InsetCaption const * getCaptionInset() const;
122 InsetFloatParams params_;
130 #endif // INSET_FLOAT_H