X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetWrap.h;h=1ad80c570d6452f28c65dbe3f2b6f2664bfb1f39;hb=d6f1915684328c6e3fe61c6eef8846b5cabec334;hp=9bf84475e35da40e94eae91042d65eb9b8ec4761;hpb=c8d00ed1272cd489041bed2115081008b6a26489;p=lyx.git diff --git a/src/insets/InsetWrap.h b/src/insets/InsetWrap.h index 9bf84475e3..1ad80c570d 100644 --- a/src/insets/InsetWrap.h +++ b/src/insets/InsetWrap.h @@ -13,8 +13,7 @@ #define INSETWRAP_H #include "InsetCollapsable.h" -#include "lyxlength.h" -#include "MailInset.h" +#include "Length.h" namespace lyx { @@ -25,14 +24,18 @@ 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; }; @@ -41,71 +44,55 @@ public: class InsetWrap : public InsetCollapsable { public: /// - InsetWrap(BufferParams const &, std::string const &); + InsetWrap(Buffer const &, std::string const &); /// ~InsetWrap(); /// - void write(Buffer const & buf, std::ostream & os) const; - /// - void read(Buffer const & buf, LyXLex & lex); + InsetWrapParams const & params() const { return params_; } /// - void validate(LaTeXFeatures & features) const; + static void string2params(std::string const &, InsetWrapParams &); /// - InsetBase::Code lyxCode() const { return InsetBase::WRAP_CODE; } + static std::string params2string(InsetWrapParams const &); +private: /// - 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; + int latex(odocstream &, OutputParams const &) const; /// - bool showInsetDialog(BufferView *) const; + int plaintext(odocstream &, OutputParams const &) const; /// - InsetWrapParams const & params() const { return params_; } + int docbook(odocstream &, OutputParams const &) const; /// - bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const; -protected: + docstring editMessage() 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_; } + bool showInsetDialog(BufferView *) const; /// - virtual std::string const & name() const { return name_; } + bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; + // Update the counters of this inset and of its contents + void updateLabels(ParIterator const &); /// - virtual std::string const inset2string(Buffer const &) const; + void doDispatch(Cursor & cur, FuncRequest & cmd); /// - static void string2params(std::string const &, InsetWrapParams &); + docstring getCaptionText(OutputParams const &) const; /// - static std::string const params2string(InsetWrapParams const &); -private: + docstring name() const; /// - static std::string const name_; + Inset * clone() const { return new InsetWrap(*this); } + /// - InsetWrap & inset_; + InsetWrapParams params_; }; - } // namespace lyx #endif