X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetFloat.h;h=62b5873b9024520e4eb570dad802bf1cce77a3bc;hb=88e5e5fd345c280b0927ad84785657cbc9e55f77;hp=d656fdcbc25cf39af6d7c35ed6e06a1668c34f6f;hpb=4c9f0eb5e6c835f5cf9cd0b0f5380b4b375d2f7c;p=lyx.git diff --git a/src/insets/InsetFloat.h b/src/insets/InsetFloat.h index d656fdcbc2..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 &); /// @@ -67,9 +72,15 @@ public: void setNewLabel(); /// InsetFloatParams const & params() const { return params_; } + /// + bool allowsCaptionVariation(std::string const &) const; + /// + LyXAlignment contentAlignment() const; private: /// - docstring name() const; + void setCaptionType(std::string const & type); + /// + docstring layoutName() const; /// docstring toolTip(BufferView const & bv, int x, int y) const; /// @@ -81,32 +92,35 @@ private: /// InsetCode lyxCode() const { return FLOAT_CODE; } /// - int latex(odocstream &, OutputParams const &) const; + 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; /// docstring xhtml(XHTMLStream &, OutputParams const &) const; /// bool insetAllowed(InsetCode) const; - /** returns true if, when outputing LaTeX, font changes should + /** returns false if, when outputing LaTeX, font changes should be closed before generating this inset. This is needed for insets that may contain several paragraphs */ - bool noFontChange() const { return true; } - /// - bool showInsetDialog(BufferView *) const; + bool inheritFont() const { return false; } /// bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; - // Update the counters of this inset and of its contents - void updateLabels(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_; };