+// -*- C++ -*-
/**
* \file insetwrap.h
* This file is part of LyX, the document processor.
#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 &);
-/** The wrap inset
+ ///
+ string type;
+ ///
+ string placement;
+ ///
+ LyXLength width;
+};
-*/
+
+/** The wrap inset
+ */
class InsetWrap : public InsetCollapsable {
public:
///
InsetWrap(BufferParams const &, string const &);
///
- InsetWrap(InsetWrap const &, bool same_id = false);
- ///
~InsetWrap();
///
+ virtual dispatch_result localDispatch(FuncRequest const & cmd);
+ ///
void write(Buffer const * buf, std::ostream & os) const;
///
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;
///
string const editMessage() const;
///
- bool insetAllowed(Inset::Code) const;
+ bool insetAllowed(InsetOld::Code) const;
///
- int getMaxWidth(BufferView *, UpdatableInset const *) const;
+ void addToToc(lyx::toc::TocList &, Buffer const *) const;
///
- string const & type() const;
+ bool showInsetDialog(BufferView *) const;
///
- LyXLength const & pageWidth() const;
- ///
- void pageWidth(LyXLength const &);
+ int latexTextWidth(BufferView *) const;
///
- void placement(string const & p);
+ InsetWrapParams const & params() const { return params_; }
+private:
+ ///
+ InsetWrapParams params_;
+};
+
+
+
+#include "mailinset.h"
+
+
+class InsetWrapMailer : public MailInset {
+public:
///
- string const & placement() const;
+ InsetWrapMailer(InsetWrap & inset);
///
- bool showInsetDialog(BufferView *) const;
+ virtual InsetBase & inset() const { return inset_; }
///
- boost::signal0<void> hideDialog;
+ virtual string const & name() const { return name_; }
///
- int latexTextWidth(BufferView *) const;
-private:
+ virtual string const inset2string(Buffer const &) const;
+ ///
+ static void string2params(string const &, InsetWrapParams &);
///
- string Type_;
+ static string const params2string(InsetWrapParams const &);
+private:
///
- string Placement_;
+ static string const name_;
///
- LyXLength width_;
+ InsetWrap & inset_;
};
#endif