]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetfloat.h
convert graphics for .tex export, fixes bug 1231
[lyx.git] / src / insets / insetfloat.h
index bfea7de0f7fd476a7f4c89dd8a42e5889999b287..633d0a75330087d20e321948541b1ef4a254adc6 100644 (file)
@@ -1,27 +1,39 @@
 // -*- C++ -*-
-/* This file is part of
- * ======================================================
+/**
+ * \file insetfloat.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
+ * \author Jürgen Vigna
+ * \author Lars Gullik Bjønnes
  *
- *           Copyright 1998 The LyX Team.
- *
- * ======================================================
+ * 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), sideways(false) {}
+       ///
+       void write(std::ostream & os) const;
+       ///
+       void read(LyXLex & lex);
+       ///
+       std::string type;
+       ///
+       std::string placement;
+       ///
+       bool wide;
+       ///
+       bool sideways;
+};
+
 
 /** The float inset
 
@@ -29,52 +41,76 @@ class Painter;
 class InsetFloat : public InsetCollapsable {
 public:
        ///
-       InsetFloat(BufferParams const &, string const &);
-       ///
-       InsetFloat(InsetFloat const &, bool same_id = false);
+       InsetFloat(BufferParams const &, std::string const &);
        ///
        ~InsetFloat();
        ///
-       void write(Buffer const * buf, std::ostream & os) const;
+       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;
-       ///
-       Inset::Code lyxCode() const { return Inset::FLOAT_CODE; }
+       virtual std::auto_ptr<InsetBase> clone() const;
        ///
-       int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
+       InsetOld::Code lyxCode() const { return InsetOld::FLOAT_CODE; }
        ///
-       int docbook(Buffer const *, std::ostream &, bool mixcont) const;
+       int latex(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
-       string const editMessage() const;
+       int linuxdoc(Buffer const &, std::ostream &,
+                    OutputParams const &) const;
        ///
-       bool insetAllowed(Inset::Code) const;
+       int docbook(Buffer const &, std::ostream &,
+                   OutputParams const &) const;
        ///
-       string const & type() const;
+       std::string const editMessage() const;
        ///
-       void placement(string const & p);
+       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 */
+       bool noFontChange() const { return true; }
        ///
-       string const & placement() const;
+       void wide(bool w, BufferParams const &);
        ///
-       void wide(bool w);
+       void sideways(bool s, BufferParams const &);
        ///
-       bool wide() const;
-       ///
-       void addToToc(toc::TocList &, Buffer const *) const;
+       void addToToc(lyx::toc::TocList &, Buffer const &) const;
        ///
        bool  showInsetDialog(BufferView *) const;
        ///
-       boost::signal0<void> hideDialog;
+       InsetFloatParams const & params() const { return params_; }
+protected:
+       virtual void priv_dispatch(LCursor & cur, FuncRequest & cmd);
 private:
        ///
-       string floatType_;
+       InsetFloatParams params_;
+};
+
+
+#include "mailinset.h"
+
+
+class InsetFloatMailer : public MailInset {
+public:
+       ///
+       InsetFloatMailer(InsetFloat & inset);
+       ///
+       virtual InsetBase & 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:
        ///
-       string floatPlacement_;
+       static std::string const name_;
        ///
-       bool wide_;
+       InsetFloat & inset_;
 };
 
 #endif