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 editMessage() const;
96 bool insetAllowed(InsetCode) const;
97 /** returns true if, when outputing LaTeX, font changes should
98 be closed before generating this inset. This is needed for
99 insets that may contain several paragraphs */
100 bool noFontChange() const { return true; }
102 bool showInsetDialog(BufferView *) const;
104 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
105 // Update the counters of this inset and of its contents
106 void updateLabels(ParIterator const &);
108 void doDispatch(Cursor & cur, FuncRequest & cmd);
110 Inset * clone() const { return new InsetFloat(*this); }
112 docstring getCaption(OutputParams const &) const;
114 docstring getCaptionText(OutputParams const &) const;
116 InsetCaption const * getCaptionInset() const;
118 InsetFloatParams params_;
126 #endif // INSET_FLOAT_H