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 "InsetCaptionable.h"
21 class InsetFloatParams
25 InsetFloatParams() : type("senseless"), 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 InsetCaptionable
54 InsetFloat(Buffer * buffer, std::string params_str);
56 static void string2params(std::string const &, InsetFloatParams &);
58 static std::string params2string(InsetFloatParams const &);
60 void setWide(bool w, bool update_label = true);
62 void setSideways(bool s, bool update_label = true);
64 void setSubfloat(bool s, bool update_label = true);
68 InsetFloatParams const & params() const { return params_; }
70 bool allowsCaptionVariation(std::string const &) const;
73 void setCaptionType(std::string const & type);
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 bool hasSubCaptions(ParIterator const & it) const;
106 void doDispatch(Cursor & cur, FuncRequest & cmd);
108 Inset * clone() const { return new InsetFloat(*this); }
110 docstring getCaption(OutputParams const &) const;
112 void getCaption(otexstream & os, OutputParams const & runparams) const;
114 InsetFloatParams params_;
120 #endif // INSET_FLOAT_H