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");
52 pi.pain.line(x, y, x + dim_.wid, y, LColor::topline, Painter::line_solid,
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 LatexRunParams const &) const
85 int InsetPagebreak::ascii(Buffer const &, ostream & os, int) const
87 os << "-------------------------------------------";
92 int InsetPagebreak::linuxdoc(Buffer const &, std::ostream & os) const
99 int InsetPagebreak::docbook(Buffer const &, std::ostream & os, bool) const