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
25 InsetFloatParams() : wide(false), sideways(false), subfloat(false) {}
27 void write(std::ostream & os) const;
29 void read(Lexer & lex);
33 std::string placement;
44 /////////////////////////////////////////////////////////////////////////
48 /////////////////////////////////////////////////////////////////////////
50 /// Used for "floating" objects like tables, figures etc.
51 class InsetFloat : public InsetCollapsable
55 InsetFloat(Buffer * buffer, std::string params_str);
58 static void string2params(std::string const &, InsetFloatParams &);
60 static std::string params2string(InsetFloatParams const &);
62 void setWide(bool w, bool update_label = true);
64 void setSideways(bool s, bool update_label = true);
66 void setSubfloat(bool s, bool update_label = true);
70 InsetFloatParams const & params() const { return params_; }
72 bool allowsCaptionVariation(std::string const &) const;
75 docstring layoutName() const;
77 docstring toolTip(BufferView const & bv, int x, int y) const;
79 void write(std::ostream & os) const;
81 void read(Lexer & lex);
83 void validate(LaTeXFeatures & features) const;
85 InsetCode lyxCode() const { return FLOAT_CODE; }
87 void latex(otexstream &, OutputParams const &) const;
89 int plaintext(odocstringstream & ods, OutputParams const & op,
90 size_t max_length = INT_MAX) const;
92 int docbook(odocstream &, OutputParams const &) const;
94 docstring xhtml(XHTMLStream &, OutputParams const &) const;
96 bool insetAllowed(InsetCode) const;
97 /** returns false 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 inheritFont() const { return false; }
102 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
104 void addToToc(DocIterator const & di, bool output_active) const;
105 /// Update the counters of this inset and of its contents
106 void updateBuffer(ParIterator const &, UpdateType);
108 void doDispatch(Cursor & cur, FuncRequest & cmd);
110 Inset * clone() const { return new InsetFloat(*this); }
112 docstring getCaption(OutputParams const &) const;
114 InsetFloatParams params_;
120 #endif // INSET_FLOAT_H