+// -*- C++ -*-
/**
* \file insetwrap.h
* This file is part of LyX, the document processor.
*
* \author Dekel Tsur
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*/
-#ifndef InsetWrap_H
-#define InsetWrap_H
-
-#ifdef __GNUG__
-#pragma interface
-#endif
+#ifndef INSETWRAP_H
+#define INSETWRAP_H
#include "insetcollapsable.h"
-#include "toc.h"
#include "lyxlength.h"
+#include "mailinset.h"
-#include <boost/signals/signal0.hpp>
-class Painter;
+namespace lyx {
-/** The wrap inset
-*/
-class InsetWrap : public InsetCollapsable {
+class InsetWrapParams {
public:
///
- InsetWrap(BufferParams const &, string const &);
+ void write(std::ostream &) const;
+ ///
+ void read(LyXLex &);
+
+ ///
+ std::string type;
+ ///
+ std::string placement;
+ ///
+ LyXLength width;
+};
+
+
+/** The wrap inset
+ */
+class InsetWrap : public InsetCollapsable {
+public:
///
- InsetWrap(InsetWrap const &, bool same_id = false);
+ InsetWrap(BufferParams const &, std::string const &);
///
~InsetWrap();
///
- 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;
+ InsetBase::Code lyxCode() const { return InsetBase::WRAP_CODE; }
///
- Inset::Code lyxCode() const { return Inset::WRAP_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;
///
- int docbook(Buffer const *, std::ostream &, bool mixcont) const;
+ virtual docstring const editMessage() const;
///
- string const editMessage() const;
+ bool insetAllowed(InsetBase::Code) const;
///
- bool insetAllowed(Inset::Code) const;
+ void addToToc(TocList &, Buffer const &) const;
///
- int getMaxWidth(BufferView *, UpdatableInset const *) const;
+ bool showInsetDialog(BufferView *) const;
///
- string const & type() const;
+ InsetWrapParams const & params() const { return params_; }
///
- LyXLength const & pageWidth() const;
+ bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
+protected:
///
- void pageWidth(LyXLength const &);
+ virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
+private:
+ virtual std::auto_ptr<InsetBase> doClone() const;
+
///
- void placement(string const & p);
+ InsetWrapParams params_;
+};
+
+
+class InsetWrapMailer : public MailInset {
+public:
///
- string const & placement() const;
+ InsetWrapMailer(InsetWrap & inset);
///
- void addToToc(toc::TocList &, Buffer const *) const;
+ virtual InsetBase & inset() const { return inset_; }
///
- bool showInsetDialog(BufferView *) const;
+ virtual std::string const & name() const { return name_; }
///
- boost::signal0<void> hideDialog;
+ virtual std::string const inset2string(Buffer const &) const;
///
- int latexTextWidth(BufferView *) const;
-private:
+ static void string2params(std::string const &, InsetWrapParams &);
///
- string Type_;
+ static std::string const params2string(InsetWrapParams const &);
+private:
///
- string Placement_;
+ static std::string const name_;
///
- LyXLength width_;
+ InsetWrap & inset_;
};
+
+} // namespace lyx
+
#endif