]> git.lyx.org Git - lyx.git/blob - src/insets/InsetNewline.h
Cosmetics.
[lyx.git] / src / insets / InsetNewline.h
1 // -*- C++ -*-
2 /**
3  * \file InsetNewline.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef INSET_NEWLINE_H
13 #define INSET_NEWLINE_H
14
15 #include "Inset.h"
16
17 #include "support/docstring.h"
18 #include "support/gettext.h"
19
20
21 namespace lyx {
22
23 class InsetNewline : public Inset
24 {
25 public:
26         ///
27         InsetNewline() {}
28         ///
29         InsetCode lyxCode() const { return NEWLINE_CODE; }
30         ///
31         void metrics(MetricsInfo &, Dimension &) const;
32         ///
33         void draw(PainterInfo & pi, int x, int y) const;
34         ///
35         int latex(odocstream &, OutputParams const &) const;
36         ///
37         int plaintext(odocstream &, OutputParams const &) const;
38         ///
39         int docbook(odocstream &, OutputParams const &) const;
40         ///
41         void read(Lexer & lex);
42         ///
43         void write(std::ostream & os) const;
44         /// We don't need \begin_inset and \end_inset
45         bool directWrite() const { return true; }
46         /// is this equivalent to a space (which is BTW different from
47         /// a line separator)?
48         bool isSpace() const;
49         ///
50         docstring insetLabel() const { return docstring(); }
51         ///
52         std::string getLyXName() const { return "\\newline"; }
53         ///
54         std::string getCmdName() const { return "\\\\"; }
55         ///
56         ColorCode ColorName() const { return Color_eolmarker; }
57
58 private:
59         ///
60         Inset * clone() const { return new InsetNewline(*this); }
61 };
62
63
64 class InsetLinebreak : public InsetNewline
65 {
66 public:
67         ///
68         InsetLinebreak() {}
69         ///
70         docstring insetLabel() const { return _("line break"); }
71         ///
72         std::string getLyXName() const { return "\\linebreak"; }
73         ///
74         std::string getCmdName() const { return "\\linebreak{}"; }
75         ///
76         ColorCode ColorName() const { return Color_pagebreak; }
77
78 private:
79         ///
80         Inset * clone() const { return new InsetLinebreak(*this); }
81 };
82
83
84 } // namespace lyx
85
86 #endif // INSET_NEWLINE_H