]> git.lyx.org Git - lyx.git/blob - src/insets/InsetNewpage.h
Remove TextClassPtr without losing the type safety it provided.
[lyx.git] / src / insets / InsetNewpage.h
1 // -*- C++ -*-
2 /**
3  * \file InsetNewpage.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author André Pönitz
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef INSET_NEWPAGE_H
13 #define INSET_NEWPAGE_H
14
15
16 #include "Inset.h"
17 #include "support/gettext.h"
18
19
20 namespace lyx {
21
22 class InsetNewpage : public Inset {
23 public:
24         InsetNewpage() {}
25
26         InsetCode lyxCode() const { return NEWPAGE_CODE; }
27
28         void metrics(MetricsInfo &, Dimension &) const;
29
30         void draw(PainterInfo & pi, int x, int y) const;
31
32         int latex(odocstream &, OutputParams const &) const;
33
34         int plaintext(odocstream &, OutputParams const &) const;
35
36         int docbook(odocstream &, OutputParams const &) const;
37
38         void read(Lexer & lex); 
39
40         void write(std::ostream & os) const;
41         /// We don't need \begin_inset and \end_inset
42         bool directWrite() const { return true; }
43
44         DisplayType display() const { return AlignCenter; }
45
46         virtual docstring insetLabel() const { return _("New Page"); }
47
48         virtual std::string getCmdName() const { return "\\newpage"; }
49
50         virtual ColorCode ColorName() const { return Color_newpage; }
51
52 private:
53         Inset * clone() const { return new InsetNewpage; }
54 };
55
56
57 class InsetPagebreak : public InsetNewpage {
58 public:
59         InsetPagebreak() {}
60
61         docstring insetLabel() const { return _("Page Break"); }
62
63         std::string getCmdName() const { return "\\pagebreak"; }
64
65         ColorCode ColorName() const { return Color_pagebreak; }
66
67 private:
68         virtual Inset * clone() const
69         {
70                 return new InsetPagebreak;
71         }
72 };
73
74
75 class InsetClearPage : public InsetNewpage {
76 public:
77         InsetClearPage() {}
78
79         docstring insetLabel() const { return _("Clear Page"); }
80
81         std::string getCmdName() const { return "\\clearpage"; }
82
83 private:
84         virtual Inset * clone() const
85         {
86                 return new InsetClearPage;
87         }
88 };
89
90
91 class InsetClearDoublePage : public InsetNewpage {
92 public:
93         InsetClearDoublePage() {}
94
95         docstring insetLabel() const { return _("Clear Double Page"); }
96
97         std::string getCmdName() const { return "\\cleardoublepage"; }
98
99 private:
100         virtual Inset * clone() const
101         {
102                 return new InsetClearDoublePage;
103         }
104 };
105
106 } // namespace lyx
107
108 #endif // INSET_NEWPAGE_H