X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetFloat.h;h=f146e11fac20ba989028b59a421d214eb9d1156f;hb=e4c46abeb7385960c9dd42494e3c7c1f3e699b56;hp=502422a21b965a2966cd5e6dd020244df1f3cc78;hpb=c246076ed57e0ee80320477349d25330e9d24e64;p=lyx.git diff --git a/src/insets/InsetFloat.h b/src/insets/InsetFloat.h index 502422a21b..f146e11fac 100644 --- a/src/insets/InsetFloat.h +++ b/src/insets/InsetFloat.h @@ -13,15 +13,19 @@ #ifndef INSET_FLOAT_H #define INSET_FLOAT_H -#include "InsetCollapsable.h" +#include "InsetCaptionable.h" namespace lyx { -class InsetFloatParams { +struct TexString; + + +class InsetFloatParams +{ public: /// - InsetFloatParams() : wide(false), sideways(false), subfloat(false) {} + InsetFloatParams() : type("senseless"), wide(false), sideways(false), subfloat(false) {} /// void write(std::ostream & os) const; /// @@ -47,12 +51,10 @@ public: ///////////////////////////////////////////////////////////////////////// /// Used for "floating" objects like tables, figures etc. -class InsetFloat : public InsetCollapsable +class InsetFloat : public InsetCaptionable { public: - /// InsetFloat(Buffer * buffer, std::string params_str); - /// static void string2params(std::string const &, InsetFloatParams &); /// @@ -68,8 +70,10 @@ public: /// InsetFloatParams const & params() const { return params_; } /// - bool allowsCaptionVariation() const { return !params_.subfloat; } + bool allowsCaptionVariation(std::string const &) const; private: + /// + void setCaptionType(std::string const & type); /// docstring layoutName() const; /// @@ -85,7 +89,8 @@ private: /// void latex(otexstream &, OutputParams const &) const; /// - int plaintext(odocstream &, OutputParams const &) const; + int plaintext(odocstringstream & ods, OutputParams const & op, + size_t max_length = INT_MAX) const; /// int docbook(odocstream &, OutputParams const &) const; /// @@ -98,15 +103,15 @@ private: bool inheritFont() const { return false; } /// bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; - // Update the counters of this inset and of its contents - void updateBuffer(ParIterator const &, UpdateType); + /// + bool hasSubCaptions(ParIterator const & it) const; /// void doDispatch(Cursor & cur, FuncRequest & cmd); /// Inset * clone() const { return new InsetFloat(*this); } /// - docstring getCaption(OutputParams const &) const; - /// + TexString getCaption(OutputParams const &) const; + InsetFloatParams params_; };