]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetFloat.h
Fix bug #8782.
[lyx.git] / src / insets / InsetFloat.h
index 65c306a93e076e9a04a22f36b0b1cdb50029f0a9..9c202678fc5557a8a16fc56ba25f0b7e1e09e779 100644 (file)
 #ifndef INSET_FLOAT_H
 #define INSET_FLOAT_H
 
-#include "InsetCollapsable.h"
+#include "InsetCaptionable.h"
 
 
 namespace lyx {
 
-class InsetCaption;
-
-class InsetFloatParams {
+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;
        ///
@@ -49,31 +48,31 @@ public:
 /////////////////////////////////////////////////////////////////////////
 
 /// Used for "floating" objects like tables, figures etc.
-class InsetFloat : public InsetCollapsable
+class InsetFloat : public InsetCaptionable
 {
 public:
-       ///
-       InsetFloat(Buffer const &, std::string const &);
-       ///
-       ~InsetFloat();
-
+       InsetFloat(Buffer * buffer, std::string params_str);
        ///
        static void string2params(std::string const &, InsetFloatParams &);
        ///
        static std::string params2string(InsetFloatParams const &);
        ///
-       void setWide(bool w, BufferParams const &, bool update_label = true);
+       void setWide(bool w, bool update_label = true);
        ///
-       void setSideways(bool s, BufferParams const &, bool update_label = true);
+       void setSideways(bool s, bool update_label = true);
        ///
-       void setSubfloat(bool s, BufferParams const &, bool update_label = true);
+       void setSubfloat(bool s, bool update_label = true);
        ///
-       void setNewLabel(BufferParams const &);
+       void setNewLabel();
        ///
        InsetFloatParams const & params() const { return params_; }
+       ///
+       bool allowsCaptionVariation(std::string const &) const;
 private:
        ///
-       docstring name() const;
+       void setCaptionType(std::string const & type);
+       ///
+       docstring layoutName() const;
        ///
        docstring toolTip(BufferView const & bv, int x, int y) const;
        ///
@@ -85,27 +84,24 @@ 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(odocstream &, OutputParams const &) const;
-       ///
-       docstring editMessage() 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 &);
+       ///
+       bool hasSubCaptions(ParIterator const & it) const;
        ///
        void doDispatch(Cursor & cur, FuncRequest & cmd);
        ///
@@ -113,15 +109,9 @@ private:
        ///
        docstring getCaption(OutputParams const &) const;
        ///
-       docstring getCaptionText(OutputParams const &) const;
-       ///
-       docstring getCaptionHTML(OutputParams const &) const;
-       ///
-       InsetCaption const * getCaptionInset() const;
-       ///
+       void getCaption(otexstream & os, OutputParams const & runparams) const;
+
        InsetFloatParams params_;
-       ///
-       docstring name_;
 };