]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetFloat.h
This optional argument to the InsetCollapsable constructor
[lyx.git] / src / insets / InsetFloat.h
index e068554408c4f46bd289012b97a3cae7dbf9aab1..b1500f9a0ed99d9d17ea3e0ecdf57bdd59ce2a4d 100644 (file)
  * Full author contact details are available in file CREDITS.
  */
 
-#ifndef INSETFLOAT_H
-#define INSETFLOAT_H
+#ifndef INSET_FLOAT_H
+#define INSET_FLOAT_H
 
 #include "InsetCollapsable.h"
-#include "MailInset.h"
 
 
 namespace lyx {
 
-
 class InsetFloatParams {
 public:
        ///
@@ -32,7 +30,7 @@ public:
        std::string type;
        ///
        std::string placement;
-       ///
+       /// span columns
        bool wide;
        ///
        bool sideways;
@@ -41,18 +39,42 @@ public:
 };
 
 
-/** The float inset
 
-*/
-class InsetFloat : public InsetCollapsable {
+/////////////////////////////////////////////////////////////////////////
+//
+// InsetFloat
+//
+/////////////////////////////////////////////////////////////////////////
+
+/// Used for "floating" objects like tables, figures etc.
+class InsetFloat : public InsetCollapsable
+{
 public:
        ///
        InsetFloat(Buffer const &, std::string const &);
        ///
        ~InsetFloat();
+
+       ///
+       static void string2params(std::string const &, InsetFloatParams &);
+       ///
+       static std::string params2string(InsetFloatParams const &);
+       ///
+       void setWide(bool w, BufferParams const &, bool update_label = true);
+       ///
+       void setSideways(bool s, BufferParams const &, bool update_label = true);
+       ///
+       void setSubfloat(bool s, BufferParams const &, bool update_label = true);
+       ///
+       void setNewLabel(BufferParams const &);
+       ///
+       InsetFloatParams const & params() const { return params_; }
+private:
        ///
        docstring name() const { return name_; }
        ///
+       docstring toolTip(BufferView const & bv, int x, int y) const;
+       ///
        void write(std::ostream & os) const;
        ///
        void read(Lexer & lex);
@@ -61,8 +83,6 @@ public:
        ///
        InsetCode lyxCode() const { return FLOAT_CODE; }
        ///
-       bool isMacroScope() const { return true; }
-       ///
        int latex(odocstream &, OutputParams const &) const;
        ///
        int plaintext(odocstream &, OutputParams const &) const;
@@ -77,16 +97,7 @@ public:
            insets that may contain several paragraphs */
        bool noFontChange() const { return true; }
        ///
-       void wide(bool w, BufferParams const &);
-       ///
-       void sideways(bool s, BufferParams const &);
-       ///
-       void subfloat(bool s, BufferParams const &);
-       ///
        bool showInsetDialog(BufferView *) const;
-       ///
-       InsetFloatParams const & params() const { return params_; }
-private:
        ///
        bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
        // Update the counters of this inset and of its contents
@@ -98,34 +109,14 @@ private:
        ///
        docstring getCaption(OutputParams const &) const;
        ///
+       docstring getCaptionText(OutputParams const &) const;
+       ///
        InsetFloatParams params_;
        ///
        docstring name_;
 };
 
 
-class InsetFloatMailer : public MailInset {
-public:
-       ///
-       InsetFloatMailer(InsetFloat & inset);
-       ///
-       virtual Inset & inset() const { return inset_; }
-       ///
-       virtual std::string const & name() const { return name_; }
-       ///
-       virtual std::string const inset2string(Buffer const &) const;
-       ///
-       static void string2params(std::string const &, InsetFloatParams &);
-       ///
-       static std::string const params2string(InsetFloatParams const &);
-private:
-       ///
-       static std::string const name_;
-       ///
-       InsetFloat & inset_;
-};
-
-
 } // namespace lyx
 
-#endif
+#endif // INSET_FLOAT_H