]> git.lyx.org Git - lyx.git/blob - src/insets/InsetNewpage.h
Fix GRAPHICS_EDIT of InsetGraphics
[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 #include "Inset.h"
16
17 #include "support/docstring.h"
18 #include "support/gettext.h"
19
20
21 namespace lyx {
22
23 class InsetNewpage : public Inset
24 {
25 public:
26         ///
27         InsetNewpage() {}
28         ///
29         InsetCode lyxCode() const { return NEWPAGE_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         ///
47         DisplayType display() const { return AlignCenter; }
48         ///
49         docstring insetLabel() const { return _("New Page"); }
50         ///
51         std::string getCmdName() const { return "\\newpage"; }
52         ///
53         ColorCode ColorName() const { return Color_newpage; }
54 private:
55         ///
56         Inset * clone() const { return new InsetNewpage(*this); }
57 };
58
59
60 class InsetPagebreak : public InsetNewpage
61 {
62 public:
63         ///
64         InsetPagebreak() {}
65         ///
66         docstring insetLabel() const { return _("Page Break"); }
67         ///
68         std::string getCmdName() const { return "\\pagebreak"; }
69         ///
70         ColorCode ColorName() const { return Color_pagebreak; }
71 private:
72         ///
73         Inset * clone() const { return new InsetPagebreak(*this); }
74 };
75
76
77 class InsetClearPage : public InsetNewpage
78 {
79 public:
80         ///
81         InsetClearPage() {}
82         ///
83         docstring insetLabel() const { return _("Clear Page"); }
84         ///
85         std::string getCmdName() const { return "\\clearpage"; }
86
87 private:
88         ///
89         Inset * clone() const { return new InsetClearPage(*this); }
90 };
91
92
93 class InsetClearDoublePage : public InsetNewpage
94 {
95 public:
96         ///
97         InsetClearDoublePage() {}
98         ///
99         docstring insetLabel() const { return _("Clear Double Page"); }
100         ///
101         std::string getCmdName() const { return "\\cleardoublepage"; }
102
103 private:
104         ///
105         Inset * clone() const { return new InsetClearDoublePage(*this); }
106 };
107
108 } // namespace lyx
109
110 #endif // INSET_NEWPAGE_H