X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetNewline.h;h=7e5ee37bbf8cfe88c46abf6bd45cbf8b69d5ce07;hb=c3a8b3a566e9e90f9ade72acbc723232d721d0b1;hp=94f291c9510749094c826b96e6f639c1559a2129;hpb=ed858d73e57ce7aa89e38c1bc4d799362edb0227;p=lyx.git diff --git a/src/insets/InsetNewline.h b/src/insets/InsetNewline.h index 94f291c951..7e5ee37bbf 100644 --- a/src/insets/InsetNewline.h +++ b/src/insets/InsetNewline.h @@ -14,6 +14,7 @@ #include "Inset.h" +#include "support/gettext.h" namespace lyx { @@ -23,9 +24,9 @@ public: InsetNewline() {} - Inset::Code lyxCode() const { return Inset::NEWLINE_CODE; } + InsetCode lyxCode() const { return NEWLINE_CODE; } - bool metrics(MetricsInfo &, Dimension &) const; + void metrics(MetricsInfo &, Dimension &) const; virtual void draw(PainterInfo & pi, int x, int y) const; @@ -37,12 +38,21 @@ public: virtual void read(Buffer const &, Lexer & lex); - virtual void write(Buffer const & buf, std::ostream & os) const; + virtual void write(Buffer const &, std::ostream & os) const; /// We don't need \begin_inset and \end_inset virtual bool directWrite() const { return true; } /// is this equivalent to a space (which is BTW different from // a line separator)? bool isSpace() const; + + virtual docstring insetLabel() const { return docstring(); } + + virtual std::string getLyXName() const { return "\\newline"; } + + virtual std::string getCmdName() const { return "\\\\"; } + + virtual ColorCode ColorName() const { return Color_eolmarker; } + private: virtual Inset * clone() const { @@ -50,6 +60,25 @@ private: } }; +class InsetLinebreak : public InsetNewline { +public: + InsetLinebreak() {} + + docstring insetLabel() const { return _("line break"); } + + std::string getLyXName() const { return "\\linebreak"; } + + std::string getCmdName() const { return "\\linebreak{}"; } + + ColorCode ColorName() const { return Color_pagebreak; } + +private: + virtual Inset * clone() const + { + return new InsetLinebreak; + } +}; + } // namespace lyx