// -*- 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:
///
- explicit
- InsetFloat();
+ 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;
///
- ~InsetFloat() {}
+ void read(Buffer const * buf, LyXLex & lex);
///
- void Write(Buffer const * buf, std::ostream & os) const;
+ void validate(LaTeXFeatures & features) const;
///
- void Read(Buffer const * buf, LyXLex & lex);
+ virtual std::auto_ptr<InsetBase> clone() const;
///
- void Validate(LaTeXFeatures & features) const;
+ InsetOld::Code lyxCode() const { return InsetOld::FLOAT_CODE; }
///
- Inset * Clone() const;
+ int latex(Buffer const *, std::ostream &,
+ LatexRunParams const &) const;
///
- Inset::Code LyxCode() const { return Inset::FLOAT_CODE; }
+ int linuxdoc(Buffer const *, std::ostream &) const;
+ ///
+ int docbook(Buffer const *, std::ostream &, bool mixcont) const;
+ ///
+ string const editMessage() 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 */
+ bool noFontChange() const { return true; }
+ ///
+ void wide(bool w, BufferParams const &);
+ ///
+ void addToToc(lyx::toc::TocList &, Buffer const *) const;
+ ///
+ bool showInsetDialog(BufferView *) const;
+ ///
+ InsetFloatParams const & params() const { return params_; }
+
+private:
+ ///
+ InsetFloatParams params_;
+};
+
+
+#include "mailinset.h"
+
+
+class InsetFloatMailer : public MailInset {
+public:
///
- int Latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
+ InsetFloatMailer(InsetFloat & inset);
///
- const char * EditMessage() const;
+ virtual InsetBase & inset() const { return inset_; }
///
- bool InsertInset(BufferView *, Inset * inset);
+ virtual string const & name() const { return name_; }
///
- bool InsertInsetAllowed(Inset * inset) const;
+ virtual string const inset2string(Buffer const &) const;
///
- LyXFont GetDrawFont(BufferView *, LyXParagraph * par, int pos) const;
+ static void string2params(string const &, InsetFloatParams &);
///
- void InsetButtonRelease(BufferView * bv, int x, int y, int button);
+ static string const params2string(InsetFloatParams const &);
private:
///
- string floatType;
+ static string const name_;
///
- string floatPlacement;
+ InsetFloat & inset_;
};
#endif