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/FontMetrics.h"
22 #include "frontends/Painter.h"
25 using lyx::odocstream;
26 using lyx::frontend::Painter;
32 void InsetPagebreak::read(Buffer const &, LyXLex &)
38 void InsetPagebreak::write(Buffer const &, ostream & os) const
40 os << "\n\\newpage\n";
44 void InsetPagebreak::metrics(MetricsInfo & mi, Dimension & dim) const
46 dim.asc = defaultRowHeight();
47 dim.des = defaultRowHeight();
48 dim.wid = mi.base.textwidth;
53 void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const
55 static docstring const label = _("Page Break");
58 font.setColor(LColor::pagebreak);
64 theFontMetrics(font).rectText(label, w, a, d);
66 int const text_start = int(x + (dim_.wid - w) / 2);
67 int const text_end = text_start + w;
69 pi.pain.rectText(text_start, y + d, label, font,
70 LColor::none, LColor::none);
72 pi.pain.line(x, y, text_start, y,
73 LColor::pagebreak, Painter::line_onoffdash);
74 pi.pain.line(text_end, y, int(x + dim_.wid), y,
75 LColor::pagebreak, Painter::line_onoffdash);
79 int InsetPagebreak::latex(Buffer const &, odocstream & os,
80 OutputParams const &) const
87 int InsetPagebreak::plaintext(Buffer const &, odocstream & os,
88 OutputParams const &) const
95 int InsetPagebreak::docbook(Buffer const &, std::ostream & os,
96 OutputParams const &) const