]> git.lyx.org Git - lyx.git/blob - src/insets/InsetNewline.h
rename LyXLex into Lexer
[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
16 #include "Inset.h"
17
18
19 namespace lyx {
20
21 class InsetNewline : public InsetOld {
22 public:
23
24         InsetNewline() {}
25
26         InsetBase::Code lyxCode() const { return InsetBase::NEWLINE_CODE; }
27
28         bool metrics(MetricsInfo &, Dimension &) const;
29
30         virtual void draw(PainterInfo & pi, int x, int y) const;
31
32         int latex(Buffer const &, odocstream &, OutputParams const &) const;
33
34         int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
35
36         int docbook(Buffer const &, odocstream &, OutputParams const &) const;
37
38         virtual void read(Buffer const &, Lexer & lex);
39
40         virtual void write(Buffer const & buf, std::ostream & os) const;
41         /// We don't need \begin_inset and \end_inset
42         virtual bool directWrite() const { return true; }
43         /// is this equivalent to a space (which is BTW different from
44         // a line separator)?
45         bool isSpace() const;
46 private:
47         virtual std::auto_ptr<InsetBase> doClone() const
48         {
49                 return std::auto_ptr<InsetBase>(new InsetNewline);
50         }
51 };
52
53
54 } // namespace lyx
55
56 #endif // INSET_NEWLINE_H