X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetwrap.h;h=bcf337d7a086d63f509008af942768785f6ee056;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=2090d350f942260a35bbea911e04decdd1a38a64;hpb=a6a948feb1644b51fce7a11657a5e45fed80906c;p=lyx.git diff --git a/src/insets/insetwrap.h b/src/insets/insetwrap.h index 2090d350f9..bcf337d7a0 100644 --- a/src/insets/insetwrap.h +++ b/src/insets/insetwrap.h @@ -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,61 +41,46 @@ struct InsetWrapParams { class InsetWrap : public InsetCollapsable { public: /// - InsetWrap(BufferParams const &, string const &); - /// - InsetWrap(InsetWrap const &, bool same_id = false); + 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(Buffer const &, bool same_id = false) const; - /// - Inset::Code lyxCode() const { return Inset::WRAP_CODE; } - /// - int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const; - /// - int docbook(Buffer const *, std::ostream &, bool mixcont) const; - /// - string const editMessage() const; + InsetBase::Code lyxCode() const { return InsetBase::WRAP_CODE; } /// - bool insetAllowed(Inset::Code) const; + int latex(Buffer const &, odocstream &, + OutputParams const &) const; /// - int getMaxWidth(BufferView *, UpdatableInset const *) const; + int docbook(Buffer const &, odocstream &, + OutputParams const &) const; /// - string const & type() const; + virtual docstring const editMessage() const; /// - LyXLength const & pageWidth() const; + bool insetAllowed(InsetBase::Code) const; /// - void pageWidth(LyXLength const &); + void addToToc(TocList &, Buffer const &) const; /// - void placement(string const & p); + bool showInsetDialog(BufferView *) const; /// - string const & placement() 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 doClone() const; + /// InsetWrapParams params_; }; - -#include "mailinset.h" - - class InsetWrapMailer : public MailInset { public: /// @@ -99,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