X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetVSpace.h;h=21afbcd03605392a1f999bf0e46fc4a9c656d570;hb=f365a650686cc27487f686a7803968df1f24e0b8;hp=0d90e65fc35866e1325127b9088647bf2609a694;hpb=00e305c9d9bd8b0ff54b6c58adb6192d5934ed60;p=lyx.git diff --git a/src/insets/InsetVSpace.h b/src/insets/InsetVSpace.h index 0d90e65fc3..21afbcd036 100644 --- a/src/insets/InsetVSpace.h +++ b/src/insets/InsetVSpace.h @@ -4,7 +4,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author André Pönitz + * \author André Pönitz * * Full author contact details are available in file CREDITS. */ @@ -12,77 +12,68 @@ #ifndef INSET_VSPACE_H #define INSET_VSPACE_H - #include "Inset.h" #include "VSpace.h" -#include "MailInset.h" namespace lyx { -class InsetVSpace : public InsetOld { +class InsetVSpace : public Inset +{ public: /// - InsetVSpace() {} + InsetVSpace() : Inset(0) {} /// InsetVSpace(VSpace const &); + /// How much? + VSpace const & space() const { return space_; } /// - ~InsetVSpace(); + InsetCode lyxCode() const { return VSPACE_CODE; } /// - bool metrics(MetricsInfo & mi, Dimension & dim) const; + bool hasSettings() const { return true; } /// - void draw(PainterInfo & pi, int x, int y) const; + bool clickable(BufferView const &, int, int) const { return true; } /// - int latex(Buffer const &, odocstream &, - OutputParams const &) const; + std::string contextMenuName() const; /// - int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + static void string2params(std::string const &, VSpace &); /// - int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + static std::string params2string(VSpace const &); +private: /// - void read(Buffer const &, LyXLex & lex); + void metrics(MetricsInfo & mi, Dimension & dim) const; /// - void write(Buffer const & buf, std::ostream & os) const; + void draw(PainterInfo & pi, int x, int y) const; /// - bool display() const { return true; } - /// How much? - VSpace const & space() const { return space_; } - -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; /// - docstring const label() const; - - /// - VSpace space_; -}; - - -class InsetVSpaceMailer : public MailInset { -public: + int docbook(odocstream &, OutputParams const &) const; + /// Note that this returns the inset rather than writing it, + /// so it will actually be written after the present paragraph. + /// The normal case is that this inset will be on a line by + /// itself, and in that case the present paragraph will not, + /// in fact, appear at all. + docstring xhtml(XHTMLStream &, OutputParams const &) const; /// - InsetVSpaceMailer(InsetVSpace & inset); + void read(Lexer & lex); /// - virtual InsetBase & inset() const { return inset_; } + void write(std::ostream & os) const; /// - virtual std::string const & name() const { return name_; } + DisplayType display() const { return AlignCenter; } /// - virtual std::string const inset2string(Buffer const &) const; + void doDispatch(Cursor & cur, FuncRequest & cmd); /// - static void string2params(std::string const &, VSpace &); + bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const; /// - static std::string const params2string(VSpace const &); -private: + Inset * clone() const { return new InsetVSpace(*this); } /// - static std::string const name_; + docstring const label() const; + /// - InsetVSpace & inset_; + VSpace space_; };