X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetWrap.h;h=5619dc042b73f491accce98d5c5d986ad1a3dcbc;hb=48b1e8a0aca2f3f3faa8f1f800568e47792ba9a0;hp=6f4cb90b66141f1617d657191061e71b34eec20e;hpb=39e79d8602920eefe36e898c9f415afb979521b2;p=lyx.git diff --git a/src/insets/InsetWrap.h b/src/insets/InsetWrap.h index 6f4cb90b66..5619dc042b 100644 --- a/src/insets/InsetWrap.h +++ b/src/insets/InsetWrap.h @@ -12,9 +12,9 @@ #ifndef INSETWRAP_H #define INSETWRAP_H -#include "InsetCollapsable.h" -#include "LyXLength.h" -#include "MailInset.h" +#include "InsetCaptionable.h" + +#include "support/Length.h" namespace lyx { @@ -30,82 +30,73 @@ public: /// std::string type; /// + int lines; + /// std::string placement; /// - LyXLength width; + Length overhang; + /// + Length width; }; /** The wrap inset */ -class InsetWrap : public InsetCollapsable { +class InsetWrap : public InsetCaptionable { public: /// - InsetWrap(BufferParams const &, std::string const &); + InsetWrap(Buffer *, std::string const &); /// ~InsetWrap(); /// - void write(Buffer const & buf, std::ostream & os) const; - /// - void read(Buffer const & buf, Lexer & lex); - /// - void validate(LaTeXFeatures & features) const; - /// - InsetBase::Code lyxCode() const { return InsetBase::WRAP_CODE; } + InsetWrapParams const & params() const { return params_; } /// - int latex(Buffer const &, odocstream &, - OutputParams const &) const; + static void string2params(std::string const &, InsetWrapParams &); /// - int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + static std::string params2string(InsetWrapParams const &); +private: /// - int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + void setCaptionType(std::string const & type); /// - virtual docstring const editMessage() const; + void write(std::ostream & os) const; /// - bool insetAllowed(InsetBase::Code) const; + void read(Lexer & lex); /// - void addToToc(TocList &, Buffer const &) const; + void validate(LaTeXFeatures & features) const; /// - bool showInsetDialog(BufferView *) const; + InsetCode lyxCode() const { return WRAP_CODE; } /// - InsetWrapParams const & params() const { return params_; } + docstring toolTip(BufferView const & bv, int x, int y) const; /// - bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const; -protected: + void latex(otexstream &, OutputParams const &) const; /// - virtual void doDispatch(LCursor & cur, FuncRequest & cmd); -private: - virtual std::auto_ptr doClone() const; - + int plaintext(odocstringstream & ods, OutputParams const & op, + size_t max_length = INT_MAX) const; /// - InsetWrapParams params_; -}; - - -class InsetWrapMailer : public MailInset { -public: + void docbook(XMLStream &, OutputParams const &) const; /// - InsetWrapMailer(InsetWrap & inset); + docstring xhtml(XMLStream &, OutputParams const &) const; /// - virtual InsetBase & inset() const { return inset_; } + bool insetAllowed(InsetCode) const; /// - virtual std::string const & name() const { return name_; } + bool showInsetDialog(BufferView *) const; /// - virtual std::string const inset2string(Buffer const &) const; + bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; + /// Update the label + void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false); /// - static void string2params(std::string const &, InsetWrapParams &); + void doDispatch(Cursor & cur, FuncRequest & cmd); /// - static std::string const params2string(InsetWrapParams const &); -private: + docstring layoutName() const; /// - static std::string const name_; + Inset * clone() const { return new InsetWrap(*this); } + /// Is the content of this inset part of the immediate (visible) text sequence? + bool isPartOfTextSequence() const { return false; } + /// - InsetWrap & inset_; + InsetWrapParams params_; }; - } // namespace lyx #endif