]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetfloat.h
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / insetfloat.h
index 62e51aae9eed9e80d70e31ef877700f3159ad1c3..7992d44d6cdd7d370d08884672e8e38d3ffd5551 100644 (file)
 // -*- 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 "mailinset.h"
+
+
+namespace lyx {
+
+
+class InsetFloatParams {
+public:
+       ///
+       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;
+};
 
-class Painter;
 
 /** The float inset
-  
+
 */
 class InsetFloat : public InsetCollapsable {
 public:
        ///
-       InsetFloat(string const &);
+       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;
+       void validate(LaTeXFeatures & features) const;
        ///
-       Inset * Clone() const;
+       InsetBase::Code lyxCode() const { return InsetBase::FLOAT_CODE; }
        ///
-       Inset::Code LyxCode() const { return Inset::FLOAT_CODE; }
+       int latex(Buffer const &, odocstream &,
+                 OutputParams const &) const;
        ///
-       int Latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
+       int docbook(Buffer const &, odocstream &,
+                   OutputParams const &) const;
        ///
-       const char * EditMessage() const;
+       virtual docstring const editMessage() const;
        ///
-       bool InsertInsetAllowed(Inset * inset) const;
+       bool insetAllowed(InsetBase::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 &);
        ///
-       void wide(bool w);
+       void sideways(bool s, BufferParams const &);
        ///
-       bool wide() const;
+       void addToToc(TocList &, Buffer const &) const;
+       ///
+       bool  showInsetDialog(BufferView *) const;
+       ///
+       InsetFloatParams const & params() const { return params_; }
+       ///
+       bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
+protected:
+       virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
 private:
+       virtual std::auto_ptr<InsetBase> doClone() const;
+
+       ///
+       InsetFloatParams params_;
+};
+
+
+class InsetFloatMailer : public MailInset {
+public:
        ///
-       string floatType;
+       InsetFloatMailer(InsetFloat & inset);
        ///
-       string floatPlacement;
+       virtual InsetBase & inset() const { return inset_; }
        ///
-       bool wide_;
+       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