]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetFloat.h
Remove all BufferParam arguments in InsetXXX methods (since insets know about their...
[lyx.git] / src / insets / InsetFloat.h
index e068554408c4f46bd289012b97a3cae7dbf9aab1..9ef3dcd9a98c64d25dd7a37eb90e9010bbb5fd59 100644 (file)
@@ -4,22 +4,20 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Jürgen Vigna
- * \author Lars Gullik Bjønnes
+ * \author Jürgen Vigna
+ * \author Lars Gullik Bjønnes
  *
  * 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,17 +39,41 @@ 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, bool update_label = true);
+       ///
+       void setSideways(bool s, bool update_label = true);
+       ///
+       void setSubfloat(bool s, bool update_label = true);
        ///
-       docstring name() const { return name_; }
+       void setNewLabel();
+       ///
+       InsetFloatParams const & params() const { return params_; }
+private:
+       ///
+       docstring name() const;
+       ///
+       docstring toolTip(BufferView const & bv, int x, int y) const;
        ///
        void write(std::ostream & os) const;
        ///
@@ -61,14 +83,14 @@ public:
        ///
        InsetCode lyxCode() const { return FLOAT_CODE; }
        ///
-       bool isMacroScope() const { return true; }
-       ///
        int latex(odocstream &, OutputParams const &) const;
        ///
        int plaintext(odocstream &, OutputParams const &) const;
        ///
        int docbook(odocstream &, OutputParams const &) const;
        ///
+       docstring xhtml(odocstream &, OutputParams const &) const;
+       ///
        docstring editMessage() const;
        ///
        bool insetAllowed(InsetCode) const;
@@ -77,16 +99,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
@@ -104,28 +117,6 @@ private:
 };
 
 
-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