X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetWrap.h;h=ce6b73eb03539cfdd0338712f5edb6afc34b64b5;hb=7a0f7b7046a05bb006956c6f6e678069a0a2c24a;hp=c2ec7d9716a3cea410d65d8b7de0dd6370d21e1f;hpb=897436efbb9bd641b61467d185a2dfae9839e575;p=lyx.git diff --git a/src/insets/InsetWrap.h b/src/insets/InsetWrap.h index c2ec7d9716..ce6b73eb03 100644 --- a/src/insets/InsetWrap.h +++ b/src/insets/InsetWrap.h @@ -14,7 +14,6 @@ #include "InsetCollapsable.h" #include "Length.h" -#include "MailInset.h" namespace lyx { @@ -30,8 +29,12 @@ public: /// std::string type; /// + int lines; + /// std::string placement; /// + Length overhang; + /// Length width; }; @@ -41,75 +44,54 @@ public: class InsetWrap : public InsetCollapsable { 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_; } + /// + static void string2params(std::string const &, InsetWrapParams &); + /// + static std::string params2string(InsetWrapParams const &); +private: + /// + void write(std::ostream & os) const; /// - void read(Buffer const & buf, Lexer & lex); + void read(Lexer & lex); /// void validate(LaTeXFeatures & features) const; /// - Inset::Code lyxCode() const { return Inset::WRAP_CODE; } + InsetCode lyxCode() const { return WRAP_CODE; } /// - int latex(Buffer const &, odocstream &, - OutputParams const &) const; + docstring toolTip(BufferView const & bv, int x, int y) const; /// - int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + void latex(otexstream &, OutputParams const &) const; /// - int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + int plaintext(odocstringstream & ods, OutputParams const & op, + size_t max_length = INT_MAX) const; /// - virtual docstring const editMessage() const; + int docbook(odocstream &, OutputParams const &) const; /// - bool insetAllowed(Inset::Code) const; + docstring xhtml(XHTMLStream &, OutputParams const &) const; /// - void addToToc(TocList &, Buffer const &) const; + bool insetAllowed(InsetCode) const; /// bool showInsetDialog(BufferView *) const; /// - InsetWrapParams const & params() const { return params_; } - /// bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; -protected: + /// Update the counters of this inset and of its contents + void updateBuffer(ParIterator const &, UpdateType); /// - virtual void doDispatch(Cursor & cur, FuncRequest & cmd); + void doDispatch(Cursor & cur, FuncRequest & cmd); /// - virtual docstring name() const { return name_; } -private: - virtual std::auto_ptr doClone() const; - - /// - InsetWrapParams params_; + docstring layoutName() const; /// - docstring name_; -}; - + Inset * clone() const { return new InsetWrap(*this); } -class InsetWrapMailer : public MailInset { -public: - /// - InsetWrapMailer(InsetWrap & inset); - /// - virtual Inset & inset() const { return inset_; } - /// - virtual std::string const & name() const { return name_; } - /// - virtual std::string const inset2string(Buffer const &) const; /// - static void string2params(std::string const &, InsetWrapParams &); - /// - static std::string const params2string(InsetWrapParams const &); -private: - /// - static std::string const name_; - /// - InsetWrap & inset_; + InsetWrapParams params_; }; - } // namespace lyx #endif