]> git.lyx.org Git - lyx.git/blob - src/insets/insetpagebreak.h
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / insetpagebreak.h
1 // -*- C++ -*-
2 /**
3  * \file insetpagebreak.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_PAGEBREAK_H
13 #define INSET_PAGEBREAK_H
14
15
16 #include "inset.h"
17 #include "gettext.h"
18
19
20 namespace lyx {
21
22 class InsetPagebreak : public InsetOld {
23 public:
24         InsetPagebreak() {}
25
26         InsetBase::Code lyxCode() const { return InsetBase::LINE_CODE; }
27
28         bool metrics(MetricsInfo &, Dimension &) const;
29
30         void draw(PainterInfo & pi, int x, int y) const;
31
32         virtual 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 &, LyXLex & 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         bool display() const { return true; }
48
49         virtual docstring insetLabel() const { return _("Page Break"); }
50
51         virtual std::string getCmdName() const { return "\\newpage"; }
52
53 private:
54         virtual std::auto_ptr<InsetBase> doClone() const
55         {
56                 return std::auto_ptr<InsetBase>(new InsetPagebreak);
57         }
58 };
59
60
61 class InsetClearPage : public InsetPagebreak {
62 public:
63         InsetClearPage() {}
64
65         docstring insetLabel() const { return _("Clear Page"); }
66         
67         std::string getCmdName() const { return "\\clearpage"; }
68
69 private:
70         virtual std::auto_ptr<InsetBase> doClone() const
71         {
72                 return std::auto_ptr<InsetBase>(new InsetClearPage);
73         }
74 };
75
76
77 class InsetClearDoublePage : public InsetPagebreak {
78 public:
79         InsetClearDoublePage() {}
80
81         docstring insetLabel() const { return _("Clear Double Page"); }
82         
83         std::string getCmdName() const { return "\\cleardoublepage"; }
84
85 private:
86         virtual std::auto_ptr<InsetBase> doClone() const
87         {
88                 return std::auto_ptr<InsetBase>(new InsetClearDoublePage);
89         }
90 };
91
92 } // namespace lyx
93
94 #endif // INSET_PAGEBREAK_H