X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetFloat.h;h=62b5873b9024520e4eb570dad802bf1cce77a3bc;hb=ebc2b1295a0464dde6c20a09ddc249c463a21c79;hp=f254bc48dbe45a4ebf0a6a2dd7119de36104914e;hpb=ecef54500d4d77baf4fa47eac2253679875ac08c;p=lyx.git diff --git a/src/insets/InsetFloat.h b/src/insets/InsetFloat.h index f254bc48db..62b5873b90 100644 --- a/src/insets/InsetFloat.h +++ b/src/insets/InsetFloat.h @@ -13,15 +13,20 @@ #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"), placement("document"), alignment("document"), + wide(false), sideways(false), subfloat(false) {} /// void write(std::ostream & os) const; /// @@ -30,6 +35,8 @@ public: std::string type; /// std::string placement; + /// + std::string alignment; /// span columns bool wide; /// @@ -47,12 +54,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 +73,12 @@ public: /// InsetFloatParams const & params() const { return params_; } /// - bool allowsCaptionVariation() const { return !params_.subfloat; } + bool allowsCaptionVariation(std::string const &) const; + /// + LyXAlignment contentAlignment() const; private: + /// + void setCaptionType(std::string const & type); /// docstring layoutName() const; /// @@ -99,15 +108,19 @@ 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); } + /// Is the content of this inset part of the immediate (visible) text sequence? + bool isPartOfTextSequence() const { return false; } /// - docstring getCaption(OutputParams const &) const; + TexString getCaption(OutputParams const &) const; /// + std::string getAlignment() const; + InsetFloatParams params_; };