3 * \file insetpagebreak.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef INSET_PAGEBREAK_H
13 #define INSET_PAGEBREAK_H
21 class InsetPagebreak : public InsetOld {
25 InsetBase::Code lyxCode() const { return InsetBase::LINE_CODE; }
27 void metrics(MetricsInfo &, Dimension &) const;
29 void draw(PainterInfo & pi, int x, int y) const;
31 virtual int latex(Buffer const &, odocstream &,
32 OutputParams const &) const;
34 int plaintext(Buffer const &, odocstream &,
35 OutputParams const &) const;
37 int docbook(Buffer const &, odocstream &,
38 OutputParams const &) const;
40 void read(Buffer const &, LyXLex & lex);
42 virtual void write(Buffer const & buf, std::ostream & os) const;
43 /// We don't need \begin_inset and \end_inset
44 bool directWrite() const { return true; }
46 bool display() const { return true; }
48 virtual std::string insetLabel() const { return "Page Break"; }
50 virtual std::string getCmdName() const { return "\\newpage"; }
53 virtual std::auto_ptr<InsetBase> doClone() const
55 return std::auto_ptr<InsetBase>(new InsetPagebreak);
60 class InsetClearPage : public InsetPagebreak {
64 std::string insetLabel() const { return "Clear Page"; }
66 std::string getCmdName() const { return "\\clearpage"; }
69 virtual std::auto_ptr<InsetBase> doClone() const
71 return std::auto_ptr<InsetBase>(new InsetClearPage);
76 class InsetClearDoublePage : public InsetPagebreak {
78 InsetClearDoublePage() {}
80 std::string insetLabel() const { return "Clear Double Page"; }
82 std::string getCmdName() const { return "\\cleardoublepage"; }
85 virtual std::auto_ptr<InsetBase> doClone() const
87 return std::auto_ptr<InsetBase>(new InsetClearDoublePage);
93 #endif // INSET_NEWLINE_H