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"), placement("document"), alignment("document"),
29 wide(false), sideways(false), subfloat(false) {}
31 void write(std::ostream & os) const;
33 void read(Lexer & lex);
37 std::string placement;
39 std::string alignment;
50 /////////////////////////////////////////////////////////////////////////
54 /////////////////////////////////////////////////////////////////////////
56 /// Used for "floating" objects like tables, figures etc.
57 class InsetFloat : public InsetCaptionable
60 InsetFloat(Buffer * buffer, std::string params_str);
62 static void string2params(std::string const &, InsetFloatParams &);
64 static std::string params2string(InsetFloatParams const &);
66 void setWide(bool w, bool update_label = true);
68 void setSideways(bool s, bool update_label = true);
70 void setSubfloat(bool s, bool update_label = true);
74 InsetFloatParams const & params() const { return params_; }
76 bool allowsCaptionVariation(std::string const &) const;
79 void setCaptionType(std::string const & type);
81 docstring layoutName() const;
83 docstring toolTip(BufferView const & bv, int x, int y) const;
85 void write(std::ostream & os) const;
87 void read(Lexer & lex);
89 void validate(LaTeXFeatures & features) const;
91 InsetCode lyxCode() const { return FLOAT_CODE; }
93 void latex(otexstream &, OutputParams const &) const;
95 int plaintext(odocstringstream & ods, OutputParams const & op,
96 size_t max_length = INT_MAX) const;
98 int docbook(odocstream &, OutputParams const &) const;
100 docstring xhtml(XHTMLStream &, OutputParams const &) const;
102 bool insetAllowed(InsetCode) const;
103 /** returns false if, when outputing LaTeX, font changes should
104 be closed before generating this inset. This is needed for
105 insets that may contain several paragraphs */
106 bool inheritFont() const { return false; }
108 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
110 bool hasSubCaptions(ParIterator const & it) const;
112 void doDispatch(Cursor & cur, FuncRequest & cmd);
114 Inset * clone() const { return new InsetFloat(*this); }
115 /// Is the content of this inset part of the immediate (visible) text sequence?
116 bool isPartOfTextSequence() const { return false; }
118 TexString getCaption(OutputParams const &) const;
120 InsetFloatParams params_;
126 #endif // INSET_FLOAT_H