]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetwrap.h
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / insetwrap.h
index 2724d8e95766db56792526961b9865af1300a1a4..bcf337d7a086d63f509008af942768785f6ee056 100644 (file)
@@ -1,3 +1,4 @@
+// -*- 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
-
+#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;
        ///
-       InsetWrap(InsetWrap const &, bool same_id = false);
+       void read(LyXLex &);
+
+       ///
+       std::string type;
+       ///
+       std::string placement;
+       ///
+       LyXLength width;
+};
+
+
+/** The wrap inset
+ */
+class InsetWrap : public InsetCollapsable {
+public:
+       ///
+       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; }
+       ///
+       int latex(Buffer const &, odocstream &,
+                 OutputParams const &) const;
        ///
-       Inset::Code lyxCode() const { return Inset::WRAP_CODE; }
+       int docbook(Buffer const &, odocstream &,
+                   OutputParams const &) const;
        ///
-       int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
+       virtual docstring const editMessage() const;
        ///
-       int docbook(Buffer const *, std::ostream &, bool mixcont) const;
+       bool insetAllowed(InsetBase::Code) const;
        ///
-       string const editMessage() const;
+       void addToToc(TocList &, Buffer const &) const;
        ///
-       bool insetAllowed(Inset::Code) const;
+       bool showInsetDialog(BufferView *) const;
        ///
-       int getMaxWidth(BufferView *, UpdatableInset const *) const;
+       InsetWrapParams const & params() const { return params_; }
        ///
-       string const & type() const;
+       bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
+protected:
        ///
-       LyXLength const & pageWidth() const;
+       virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
+private:
+       virtual std::auto_ptr<InsetBase> doClone() const;
+
        ///
-       void pageWidth(LyXLength const &);
+       InsetWrapParams params_;
+};
+
+
+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 std::string const & name() const { return name_; }
        ///
-       bool  showInsetDialog(BufferView *) const;
+       virtual std::string const inset2string(Buffer const &) const;
        ///
-       boost::signal0<void> hideDialog;
+       static void string2params(std::string const &, InsetWrapParams &);
        ///
-       int latexTextWidth(BufferView *) const;
+       static std::string const params2string(InsetWrapParams const &);
 private:
        ///
-       string Type_;
+       static std::string const name_;
        ///
-       string Placement_;
-       ///
-       LyXLength width_;
+       InsetWrap & inset_;
 };
 
+
+} // namespace lyx
+
 #endif