+// -*- 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
#include "insetcollapsable.h"
#include "toc.h"
#include "lyxlength.h"
-#include <boost/signals/signal0.hpp>
-class Painter;
+struct InsetWrapParams {
+ ///
+ void write(std::ostream &) const;
+ ///
+ void read(LyXLex &);
+
+ ///
+ string type;
+ ///
+ string placement;
+ ///
+ LyXLength width;
+};
-/** The wrap inset
-*/
+/** The wrap inset
+ */
class InsetWrap : public InsetCollapsable {
public:
///
InsetWrap(BufferParams const &, string const &);
///
- InsetWrap(InsetWrap const &, bool same_id = false);
- ///
~InsetWrap();
///
- void write(Buffer const * buf, std::ostream & os) const;
+ virtual dispatch_result localDispatch(FuncRequest const & cmd);
+ ///
+ 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;
+ virtual std::auto_ptr<InsetBase> clone() const;
///
- Inset::Code lyxCode() const { return Inset::WRAP_CODE; }
+ InsetOld::Code lyxCode() const { return InsetOld::WRAP_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 &, bool mixcont) const;
+ int docbook(Buffer const &, std::ostream &, bool mixcont) const;
///
string const editMessage() const;
///
- bool insetAllowed(Inset::Code) const;
+ bool insetAllowed(InsetOld::Code) const;
+ ///
+ void addToToc(lyx::toc::TocList &, Buffer const &) const;
///
- int getMaxWidth(BufferView *, UpdatableInset const *) const;
+ bool showInsetDialog(BufferView *) const;
+ ///
+ int latexTextWidth(BufferView *) const;
///
- string const & type() const;
+ InsetWrapParams const & params() const { return params_; }
+private:
///
- LyXLength const & pageWidth() const;
- ///
- void pageWidth(LyXLength const &);
+ InsetWrapParams params_;
+};
+
+
+
+#include "mailinset.h"
+
+
+class InsetWrapMailer : public MailInset {
+public:
///
- void placement(string const & p);
+ InsetWrapMailer(InsetWrap & inset);
///
- string const & placement() const;
+ virtual InsetBase & inset() const { return inset_; }
///
- void addToToc(toc::TocList &, Buffer const *) const;
+ virtual string const & name() const { return name_; }
///
- bool showInsetDialog(BufferView *) const;
+ virtual string const inset2string(Buffer const &) const;
///
- boost::signal0<void> hideDialog;
+ static void string2params(string const &, InsetWrapParams &);
///
- int latexTextWidth(BufferView *) const;
+ static string const params2string(InsetWrapParams const &);
private:
///
- string Type_;
- ///
- string Placement_;
+ static string const name_;
///
- LyXLength width_;
+ InsetWrap & inset_;
};
#endif