// -*- 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 &);
///
- 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);
///
- Inset * Clone(Buffer const &) const;
+ void validate(LaTeXFeatures & features) const;
///
- Inset::Code LyxCode() const { return Inset::FLOAT_CODE; }
+ InsetBase::Code lyxCode() const { return InsetBase::FLOAT_CODE; }
///
- int Latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
+ int latex(Buffer const &, odocstream &,
+ OutputParams const &) const;
///
- string const EditMessage() const;
+ int docbook(Buffer const &, odocstream &,
+ OutputParams const &) const;
///
- bool InsertInsetAllowed(Inset * inset) const;
+ virtual docstring const editMessage() const;
///
- void InsetButtonRelease(BufferView * bv, int x, int y, int button);
+ 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; }
///
- string const & type() const;
+ void wide(bool w, BufferParams const &);
///
- void placement(string const & p);
+ void sideways(bool s, BufferParams const &);
///
- string const & placement() const;
+ void addToToc(TocList &, Buffer const &) const;
///
- void wide(bool w);
+ bool showInsetDialog(BufferView *) const;
///
- bool wide() 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:
+ ///
+ InsetFloatMailer(InsetFloat & inset);
///
- string floatType_;
+ virtual InsetBase & inset() const { return inset_; }
///
- string floatPlacement_;
+ virtual std::string const & name() const { return name_; }
///
- bool wide_;
+ 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