]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetfloat.h
Clean up InsetGraphics::Cache and rename as GraphicsInset.
[lyx.git] / src / insets / insetfloat.h
index c92569fe2e017978fa5dcf3114a767d829a35fa1..2b83382bc3317e6f3136dbbc3c2ac9298c4ef361 100644 (file)
@@ -1,32 +1,51 @@
 // -*- C++ -*-
-/* This file is part of
- * ======================================================
- * 
- *           LyX, The Document Processor
+/**
+ * \file insetfloat.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           Copyright 1998 The LyX Team.
+ * \author Jürgen Vigna
+ * \author Lars Gullik Bjønnes
  *
- * ======================================================
+ * 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"
+
+
+struct InsetFloatParams {
+       ///
+       InsetFloatParams() : wide(false) {}
+       ///
+       void write(std::ostream & os) const;
+       ///
+       void read(LyXLex & lex);
+       ///
+       string type;
+       ///
+       string placement;
+       ///
+       bool wide;
+};
 
-class Painter;
 
 /** The float inset
-  
+
 */
 class InsetFloat : public InsetCollapsable {
 public:
        ///
-       InsetFloat(string const &);
+       InsetFloat(BufferParams const &, string const &);
+       ///
+       InsetFloat(InsetFloat const &);
+       ///
+       ~InsetFloat();
+       ///
+       virtual dispatch_result localDispatch(FuncRequest const & cmd);
        ///
        void write(Buffer const * buf, std::ostream & os) const;
        ///
@@ -34,36 +53,59 @@ public:
        ///
        void validate(LaTeXFeatures & features) const;
        ///
-       Inset * clone(Buffer const &, bool same_id = false) const;
+       Inset * clone() const;
        ///
        Inset::Code lyxCode() const { return Inset::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 &) const;
+       int docbook(Buffer const *, std::ostream &, bool mixcont) const;
        ///
        string const editMessage() const;
        ///
        bool insetAllowed(Inset::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; }
        ///
-       void insetButtonRelease(BufferView * bv, int x, int y, int button);
+       void wide(bool w, BufferParams const &);
        ///
-       string const & type() const;
+       void addToToc(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:
+       ///
+       InsetFloatParams params_;
+};
+
+
+#include "mailinset.h"
+
+
+class InsetFloatMailer : public MailInset {
+public:
        ///
-       void wide(bool w);
+       InsetFloatMailer(InsetFloat & inset);
        ///
-       bool wide() const;
-private:
+       virtual InsetBase & inset() const { return inset_; }
+       ///
+       virtual string const & name() const { return name_; }
        ///
-       string floatType_;
+       virtual string const inset2string() const;
+       ///
+       static void string2params(string const &, InsetFloatParams &);
+       ///
+       static string const params2string(InsetFloatParams const &);
+private:
        ///
-       string floatPlacement_;
+       static string const name_;
        ///
-       bool wide_;
+       InsetFloat & inset_;
 };
 
 #endif