X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetWrap.h;h=588a3bc1e16aee37b793ef86a68039a9589df6d9;hb=e5c79a43ee78192f45a9ab34873f8bb426b5f37e;hp=9bf84475e35da40e94eae91042d65eb9b8ec4761;hpb=c8d00ed1272cd489041bed2115081008b6a26489;p=lyx.git diff --git a/src/insets/InsetWrap.h b/src/insets/InsetWrap.h index 9bf84475e3..588a3bc1e1 100644 --- a/src/insets/InsetWrap.h +++ b/src/insets/InsetWrap.h @@ -12,9 +12,8 @@ #ifndef INSETWRAP_H #define INSETWRAP_H -#include "InsetCollapsable.h" -#include "lyxlength.h" -#include "MailInset.h" +#include "InsetCaptionable.h" +#include "Length.h" namespace lyx { @@ -25,87 +24,78 @@ public: /// void write(std::ostream &) const; /// - void read(LyXLex &); + void read(Lexer &); /// 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; + InsetWrapParams const & params() const { return params_; } /// - void read(Buffer const & buf, LyXLex & lex); + static void string2params(std::string const &, InsetWrapParams &); /// - void validate(LaTeXFeatures & features) const; + static std::string params2string(InsetWrapParams const &); +private: /// - InsetBase::Code lyxCode() const { return InsetBase::WRAP_CODE; } + void setCaptionType(std::string const & type); /// - int latex(Buffer const &, odocstream &, - OutputParams const &) const; + void write(std::ostream & os) const; /// - int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + void read(Lexer & lex); /// - int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + void validate(LaTeXFeatures & features) const; /// - virtual docstring const editMessage() const; + InsetCode lyxCode() const { return WRAP_CODE; } /// - bool insetAllowed(InsetBase::Code) const; + docstring toolTip(BufferView const & bv, int x, int y) const; /// - void addToToc(TocList &, Buffer const &) const; + void latex(otexstream &, OutputParams const &) const; /// - bool showInsetDialog(BufferView *) const; + int plaintext(odocstringstream & ods, OutputParams const & op, + size_t max_length = INT_MAX) const; /// - InsetWrapParams const & params() const { return params_; } + int docbook(odocstream &, OutputParams const &) const; /// - bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const; -protected: + docstring xhtml(XHTMLStream &, OutputParams const &) const; /// - virtual void doDispatch(LCursor & cur, FuncRequest & cmd); -private: - virtual std::auto_ptr doClone() const; - + bool insetAllowed(InsetCode) const; /// - InsetWrapParams params_; -}; - - -class InsetWrapMailer : public MailInset { -public: - /// - InsetWrapMailer(InsetWrap & inset); - /// - virtual InsetBase & inset() const { return inset_; } - /// - 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); /// - 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