]> 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 45324e926953fc6076623958f6cf9fe5f1e046b2..bcf337d7a086d63f509008af942768785f6ee056 100644 (file)
@@ -1,3 +1,4 @@
+// -*- C++ -*-
 /**
  * \file insetwrap.h
  * This file is part of LyX, the document processor.
@@ -5,28 +6,31 @@
  *
  * \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"
+
+
+namespace lyx {
 
 
-struct InsetWrapParams {
+class InsetWrapParams {
+public:
        ///
        void write(std::ostream &) const;
        ///
        void read(LyXLex &);
 
        ///
-       string type;
+       std::string type;
        ///
-       string placement;
+       std::string placement;
        ///
        LyXLength width;
 };
@@ -37,50 +41,46 @@ struct InsetWrapParams {
 class InsetWrap : public InsetCollapsable {
 public:
        ///
-       InsetWrap(BufferParams const &, string const &);
+       InsetWrap(BufferParams const &, std::string const &);
        ///
        ~InsetWrap();
        ///
-       virtual dispatch_result localDispatch(FuncRequest const & cmd);
-       ///
-       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() 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 &,
-                 LatexRunParams const &) 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;
        ///
-       void addToToc(toc::TocList &, Buffer const *) const;
-       ///
-       bool  showInsetDialog(BufferView *) const;
+       InsetWrapParams const & params() const { return params_; }
        ///
-       int latexTextWidth(BufferView *) const;
+       bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
+protected:
        ///
-       InsetWrapParams const & params() const { return params_; }
+       virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
 private:
+       virtual std::auto_ptr<InsetBase> doClone() const;
+
        ///
        InsetWrapParams params_;
 };
 
 
-
-#include "mailinset.h"
-
-
 class InsetWrapMailer : public MailInset {
 public:
        ///
@@ -88,18 +88,21 @@ public:
        ///
        virtual InsetBase & inset() const { return inset_; }
        ///
-       virtual string const & name() const { return name_; }
+       virtual std::string const & name() const { return name_; }
        ///
-       virtual string const inset2string() const;
+       virtual std::string const inset2string(Buffer const &) const;
        ///
-       static void string2params(string const &, InsetWrapParams &);
+       static void string2params(std::string const &, InsetWrapParams &);
        ///
-       static string const params2string(InsetWrapParams const &);
+       static std::string const params2string(InsetWrapParams const &);
 private:
        ///
-       static string const name_;
+       static std::string const name_;
        ///
        InsetWrap & inset_;
 };
 
+
+} // namespace lyx
+
 #endif