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"
24 class InsetFloatParams
28 InsetFloatParams() : type("senseless"), wide(false), sideways(false), subfloat(false) {}
30 void write(std::ostream & os) const;
32 void read(Lexer & lex);
36 std::string placement;
47 /////////////////////////////////////////////////////////////////////////
51 /////////////////////////////////////////////////////////////////////////
53 /// Used for "floating" objects like tables, figures etc.
54 class InsetFloat : public InsetCaptionable
57 InsetFloat(Buffer * buffer, std::string params_str);
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_; }
73 bool allowsCaptionVariation(std::string const &) const;
76 void setCaptionType(std::string const & type);
78 docstring layoutName() const;
80 docstring toolTip(BufferView const & bv, int x, int y) const;
82 void write(std::ostream & os) const;
84 void read(Lexer & lex);
86 void validate(LaTeXFeatures & features) const;
88 InsetCode lyxCode() const { return FLOAT_CODE; }
90 void latex(otexstream &, OutputParams const &) const;
92 int plaintext(odocstringstream & ods, OutputParams const & op,
93 size_t max_length = INT_MAX) const;
95 int docbook(odocstream &, OutputParams const &) const;
97 docstring xhtml(XHTMLStream &, OutputParams const &) const;
99 bool insetAllowed(InsetCode) const;
100 /** returns false if, when outputing LaTeX, font changes should
101 be closed before generating this inset. This is needed for
102 insets that may contain several paragraphs */
103 bool inheritFont() const { return false; }
105 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
107 bool hasSubCaptions(ParIterator const & it) const;
109 void doDispatch(Cursor & cur, FuncRequest & cmd);
111 Inset * clone() const { return new InsetFloat(*this); }
112 /// Is the content of this inset part of the immediate (visible) text sequence?
113 bool isPartOfTextSequence() const { return false; }
115 TexString getCaption(OutputParams const &) const;
117 InsetFloatParams params_;
123 #endif // INSET_FLOAT_H