]> git.lyx.org Git - lyx.git/blob - src/insets/InsetNewpage.h
* Inset: Prepare for an eventual merge of updateLabels() and addToToc()
[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(Buffer const &, odocstream &,
33                   OutputParams const &) const;
34
35         int plaintext(Buffer const &, odocstream &,
36                       OutputParams const &) const;
37
38         int docbook(Buffer const &, odocstream &,
39                     OutputParams const &) const;
40
41         void read(Buffer const &, Lexer & lex);
42
43         virtual void write(Buffer const & buf, std::ostream & os) const;
44         /// We don't need \begin_inset and \end_inset
45         bool directWrite() const { return true; }
46
47         DisplayType display() const { return AlignCenter; }
48
49         virtual docstring insetLabel() const { return _("New Page"); }
50
51         virtual std::string getCmdName() const { return "\\newpage"; }
52
53         virtual ColorCode ColorName() const { return Color_newpage; }
54
55 private:
56         virtual Inset * clone() const
57         {
58                 return new InsetNewpage;
59         }
60 };
61
62
63 class InsetPagebreak : public InsetNewpage {
64 public:
65         InsetPagebreak() {}
66
67         docstring insetLabel() const { return _("Page Break"); }
68
69         std::string getCmdName() const { return "\\pagebreak"; }
70
71         ColorCode ColorName() const { return Color_pagebreak; }
72
73 private:
74         virtual Inset * clone() const
75         {
76                 return new InsetPagebreak;
77         }
78 };
79
80
81 class InsetClearPage : public InsetNewpage {
82 public:
83         InsetClearPage() {}
84
85         docstring insetLabel() const { return _("Clear Page"); }
86
87         std::string getCmdName() const { return "\\clearpage"; }
88
89 private:
90         virtual Inset * clone() const
91         {
92                 return new InsetClearPage;
93         }
94 };
95
96
97 class InsetClearDoublePage : public InsetNewpage {
98 public:
99         InsetClearDoublePage() {}
100
101         docstring insetLabel() const { return _("Clear Double Page"); }
102
103         std::string getCmdName() const { return "\\cleardoublepage"; }
104
105 private:
106         virtual Inset * clone() const
107         {
108                 return new InsetClearDoublePage;
109         }
110 };
111
112 } // namespace lyx
113
114 #endif // INSET_NEWPAGE_H