X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetwrap.h;h=bcf337d7a086d63f509008af942768785f6ee056;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=2724d8e95766db56792526961b9865af1300a1a4;hpb=99d1627a471b92f403598d03dfc861ddc3c11be0;p=lyx.git diff --git a/src/insets/insetwrap.h b/src/insets/insetwrap.h index 2724d8e957..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,77 +6,103 @@ * * \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 -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 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 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