]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNewline.h
* Inset: Prepare for an eventual merge of updateLabels() and addToToc()
[lyx.git] / src / insets / InsetNewline.h
index 94f291c9510749094c826b96e6f639c1559a2129..7e5ee37bbf8cfe88c46abf6bd45cbf8b69d5ce07 100644 (file)
@@ -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