2 * \file insetpagebreak.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "insetpagebreak.h"
18 #include "metricsinfo.h"
21 #include "frontends/Painter.h"
22 #include "frontends/font_metrics.h"
28 void InsetPagebreak::read(Buffer const &, LyXLex &)
34 void InsetPagebreak::write(Buffer const &, ostream & os) const
36 os << "\n\\newpage \n";
40 void InsetPagebreak::metrics(MetricsInfo & mi, Dimension & dim) const
42 dim.asc = defaultRowHeight();
43 dim.des = defaultRowHeight();
44 dim.wid = mi.base.textwidth;
49 void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const
51 static std::string const label = _("Page Break");
54 font.setColor(LColor::pagebreak);
60 font_metrics::rectText(label, font, w, a, d);
62 int const text_start = int(x + (dim_.wid - w) / 2);
63 int const text_end = text_start + w;
65 pi.pain.rectText(text_start, y + d, label, font,
66 LColor::none, LColor::none);
68 pi.pain.line(x, y, text_start, y,
69 LColor::pagebreak, Painter::line_onoffdash);
70 pi.pain.line(text_end, y, int(x + dim_.wid), y,
71 LColor::pagebreak, Painter::line_onoffdash);
75 int InsetPagebreak::latex(Buffer const &, ostream & os,
76 OutputParams const &) const
83 int InsetPagebreak::plaintext(Buffer const &, ostream & os,
84 OutputParams const &) const
91 int InsetPagebreak::linuxdoc(Buffer const &, std::ostream & os,
92 OutputParams const &) const
99 int InsetPagebreak::docbook(Buffer const &, std::ostream & os,
100 OutputParams const &) const