]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetFloat.h
Fixup 572b06d6: reduce cache size for breakString
[lyx.git] / src / insets / InsetFloat.h
index a0c55a072b3db1acfde204bbe3f48d22910405b7..20ee6452e8660f415fad2403261581a401a2b2a6 100644 (file)
 #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);
-
+       InsetFloat(Buffer * buffer, std::string const & params_str);
        ///
        static void string2params(std::string const &, InsetFloatParams &);
        ///
@@ -67,44 +72,59 @@ public:
        void setNewLabel();
        ///
        InsetFloatParams const & params() const { return params_; }
+       ///
+       bool allowsCaptionVariation(std::string const &) const override;
+       ///
+       LyXAlignment contentAlignment() const override;
+       ///
+       bool forceParDirectionSwitch() const override { return true; }
 private:
        ///
-       docstring name() const;
+       void setCaptionType(std::string const & type) override;
        ///
-       docstring toolTip(BufferView const & bv, int x, int y) const;
+       docstring layoutName() const override;
        ///
-       void write(std::ostream & os) const;
+       docstring toolTip(BufferView const & bv, int x, int y) const override;
        ///
-       void read(Lexer & lex);
+       void write(std::ostream & os) const override;
+       ///
+       void read(Lexer & lex) override;
+       ///
+       void validate(LaTeXFeatures & features) const override;
        ///
-       void validate(LaTeXFeatures & features) const;
+       InsetCode lyxCode() const override { return FLOAT_CODE; }
        ///
-       InsetCode lyxCode() const { return FLOAT_CODE; }
+       void latex(otexstream &, OutputParams const &) const override;
        ///
-       int latex(odocstream &, OutputParams const &) const;
+       int plaintext(odocstringstream & ods, OutputParams const & op,
+                     size_t max_length = INT_MAX) const override;
        ///
-       int plaintext(odocstream &, OutputParams const &) const;
+       void docbook(XMLStream &, OutputParams const &) const override;
        ///
-       int docbook(odocstream &, OutputParams const &) const;
+       docstring xhtml(XMLStream &, OutputParams const &) const override;
        ///
-       docstring xhtml(XHTMLStream &, OutputParams const &) const;
+       bool insetAllowed(InsetCode) const override;
        ///
-       bool insetAllowed(InsetCode) const;
-       /** returns true 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 inheritFont() const override { 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 getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override;
        ///
-       void doDispatch(Cursor & cur, FuncRequest & cmd);
+       bool hasSubCaptions(ParIterator const & it) const override;
        ///
-       Inset * clone() const { return new InsetFloat(*this); }
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false) override;
        ///
-       docstring getCaption(OutputParams const &) const;
+       void doDispatch(Cursor & cur, FuncRequest & cmd) override;
        ///
+       Inset * clone() const override { return new InsetFloat(*this); }
+       /// Is the content of this inset part of the immediate (visible) text sequence?
+       bool isPartOfTextSequence() const override { return false; }
+       ///
+       TexString getCaption(OutputParams const &) const;
+       ///
+       std::string getAlignment() const;
+       ///
+       CtObject getCtObject(OutputParams const &) const override;
+
        InsetFloatParams params_;
 };