]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetfloat.h
Enable convertDefault.sh to run even if its executable bit is not set.
[lyx.git] / src / insets / insetfloat.h
index fd0ddea0c80c6066d2fd2f637175e5dcbfd23802..e1000de62908164ab14c17f6437f77bfb84e73de 100644 (file)
@@ -7,22 +7,31 @@
  * \author Jürgen Vigna
  * \author Lars Gullik Bjønnes
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
-#ifndef InsetFloat_H
-#define InsetFloat_H
-
-#ifdef __GNUG__
-#pragma interface
-#endif
+#ifndef INSETFLOAT_H
+#define INSETFLOAT_H
 
 #include "insetcollapsable.h"
 #include "toc.h"
 
-#include <boost/signals/signal0.hpp>
 
-class Painter;
+struct InsetFloatParams {
+       ///
+       InsetFloatParams() : wide(false) {}
+       ///
+       void write(std::ostream & os) const;
+       ///
+       void read(LyXLex & lex);
+       ///
+       string type;
+       ///
+       string placement;
+       ///
+       bool wide;
+};
+
 
 /** The float inset
 
@@ -32,54 +41,73 @@ public:
        ///
        InsetFloat(BufferParams const &, string const &);
        ///
-       InsetFloat(InsetFloat const &, bool same_id = false);
+       InsetFloat(InsetFloat const &);
        ///
        ~InsetFloat();
        ///
-       void write(Buffer const * buf, std::ostream & os) const;
+       virtual dispatch_result localDispatch(FuncRequest const & cmd);
+       ///
+       void write(Buffer const & buf, std::ostream & os) const;
        ///
-       void read(Buffer const * buf, LyXLex & lex);
+       void read(Buffer const & buf, LyXLex & lex);
        ///
        void validate(LaTeXFeatures & features) const;
        ///
-       Inset * clone(Buffer const &, bool same_id = false) const;
+       virtual std::auto_ptr<InsetBase> clone() const;
        ///
-       Inset::Code lyxCode() const { return Inset::FLOAT_CODE; }
+       InsetOld::Code lyxCode() const { return InsetOld::FLOAT_CODE; }
        ///
-       int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
+       int latex(Buffer const &, std::ostream &,
+                 LatexRunParams const &) const;
        ///
-       int docbook(Buffer const *, std::ostream &, bool mixcont) const;
+       int linuxdoc(Buffer const &, std::ostream &) const;
+       ///
+       int docbook(Buffer const &, std::ostream &, bool mixcont) const;
        ///
        string const editMessage() const;
        ///
-       bool insetAllowed(Inset::Code) const;
+       bool insetAllowed(InsetOld::Code) 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 */
+           be closed before generating this inset. This is needed for
+           insets that may contain several paragraphs */
        bool noFontChange() const { return true; }
        ///
-       string const & type() const;
+       void wide(bool w, BufferParams const &);
+       ///
+       void addToToc(lyx::toc::TocList &, Buffer const &) const;
        ///
-       void placement(string const & p);
+       bool  showInsetDialog(BufferView *) const;
        ///
-       string const & placement() const;
+       InsetFloatParams const & params() const { return params_; }
+
+private:
        ///
-       void wide(bool w, BufferParams const &);
+       InsetFloatParams params_;
+};
+
+
+#include "mailinset.h"
+
+
+class InsetFloatMailer : public MailInset {
+public:
        ///
-       bool wide() const;
+       InsetFloatMailer(InsetFloat & inset);
        ///
-       void addToToc(toc::TocList &, Buffer const *) const;
+       virtual InsetBase & inset() const { return inset_; }
        ///
-       bool  showInsetDialog(BufferView *) const;
+       virtual string const & name() const { return name_; }
        ///
-       boost::signal0<void> hideDialog;
-private:
+       virtual string const inset2string(Buffer const &) const;
+       ///
+       static void string2params(string const &, InsetFloatParams &);
        ///
-       string floatType_;
+       static string const params2string(InsetFloatParams const &);
+private:
        ///
-       string floatPlacement_;
+       static string const name_;
        ///
-       bool wide_;
+       InsetFloat & inset_;
 };
 
 #endif