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"
24 using lyx::frontend::Painter;
30 void InsetPagebreak::read(Buffer const &, LyXLex &)
36 void InsetPagebreak::write(Buffer const &, ostream & os) const
38 os << "\n\\newpage\n";
42 void InsetPagebreak::metrics(MetricsInfo & mi, Dimension & dim) const
44 dim.asc = defaultRowHeight();
45 dim.des = defaultRowHeight();
46 dim.wid = mi.base.textwidth;
51 void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const
53 static std::string const label = _("Page Break");
56 font.setColor(LColor::pagebreak);
62 font_metrics::rectText(label, font, w, a, d);
64 int const text_start = int(x + (dim_.wid - w) / 2);
65 int const text_end = text_start + w;
67 pi.pain.rectText(text_start, y + d, label, font,
68 LColor::none, LColor::none);
70 pi.pain.line(x, y, text_start, y,
71 LColor::pagebreak, Painter::line_onoffdash);
72 pi.pain.line(text_end, y, int(x + dim_.wid), y,
73 LColor::pagebreak, Painter::line_onoffdash);
77 int InsetPagebreak::latex(Buffer const &, ostream & os,
78 OutputParams const &) const
85 int InsetPagebreak::plaintext(Buffer const &, ostream & os,
86 OutputParams const &) const
93 int InsetPagebreak::linuxdoc(Buffer const &, std::ostream & os,
94 OutputParams const &) const
101 int InsetPagebreak::docbook(Buffer const &, std::ostream & os,
102 OutputParams const &) const