#ifndef INSET_NEWLINE_H
#define INSET_NEWLINE_H
-
#include "Inset.h"
+#include "support/docstring.h"
+#include "support/gettext.h"
+
namespace lyx {
-class InsetNewline : public Inset {
+class InsetNewline : public Inset
+{
public:
-
+ ///
InsetNewline() {}
-
+ ///
InsetCode lyxCode() const { return NEWLINE_CODE; }
-
+ ///
void metrics(MetricsInfo &, Dimension &) const;
+ ///
+ void draw(PainterInfo & pi, int x, int y) const;
+ ///
+ int latex(odocstream &, OutputParams const &) const;
+ ///
+ int plaintext(odocstream &, OutputParams const &) const;
+ ///
+ int docbook(odocstream &, OutputParams const &) const;
+ ///
+ void read(Lexer & lex);
+ ///
+ void write(std::ostream & os) const;
+ /// We don't need \begin_inset and \end_inset
+ bool directWrite() const { return true; }
+ /// is this equivalent to a space (which is BTW different from
+ /// a line separator)?
+ bool isSpace() const;
+ ///
+ docstring insetLabel() const { return docstring(); }
+ ///
+ std::string getLyXName() const { return "\\newline"; }
+ ///
+ std::string getCmdName() const { return "\\\\"; }
+ ///
+ ColorCode ColorName() const { return Color_eolmarker; }
- virtual void draw(PainterInfo & pi, int x, int y) const;
-
- int latex(Buffer const &, odocstream &, OutputParams const &) const;
-
- int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
+private:
+ ///
+ Inset * clone() const { return new InsetNewline(*this); }
+};
- int docbook(Buffer const &, odocstream &, OutputParams const &) const;
- virtual void read(Buffer const &, Lexer & lex);
+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; }
- virtual void write(Buffer const & buf, 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;
private:
- virtual Inset * clone() const
- {
- return new InsetNewline;
- }
+ ///
+ Inset * clone() const { return new InsetLinebreak(*this); }
};