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"
25 using lyx::frontend::Painter;
31 void InsetPagebreak::read(Buffer const &, LyXLex &)
37 void InsetPagebreak::write(Buffer const &, ostream & os) const
39 os << "\n\\newpage\n";
43 void InsetPagebreak::metrics(MetricsInfo & mi, Dimension & dim) const
45 dim.asc = defaultRowHeight();
46 dim.des = defaultRowHeight();
47 dim.wid = mi.base.textwidth;
52 void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const
54 static docstring const label = _("Page Break");
57 font.setColor(LColor::pagebreak);
63 font_metrics::rectText(label, font, w, a, d);
65 int const text_start = int(x + (dim_.wid - w) / 2);
66 int const text_end = text_start + w;
68 pi.pain.rectText(text_start, y + d, label, font,
69 LColor::none, LColor::none);
71 pi.pain.line(x, y, text_start, y,
72 LColor::pagebreak, Painter::line_onoffdash);
73 pi.pain.line(text_end, y, int(x + dim_.wid), y,
74 LColor::pagebreak, Painter::line_onoffdash);
78 int InsetPagebreak::latex(Buffer const &, ostream & os,
79 OutputParams const &) const
86 int InsetPagebreak::plaintext(Buffer const &, ostream & os,
87 OutputParams const &) const
94 int InsetPagebreak::docbook(Buffer const &, std::ostream & os,
95 OutputParams const &) const