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"
27 using frontend::Painter;
33 void InsetPagebreak::read(Buffer const &, LyXLex &)
39 void InsetPagebreak::write(Buffer const &, ostream & os) const
41 os << "\n" << getCmdName() << '\n';
45 void InsetPagebreak::metrics(MetricsInfo & mi, Dimension & dim) const
47 dim.asc = defaultRowHeight();
48 dim.des = defaultRowHeight();
49 dim.wid = mi.base.textwidth;
54 void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const
57 font.setColor(LColor::pagebreak);
63 theFontMetrics(font).rectText(insetLabel(), 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, insetLabel(), 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 &, odocstream & os,
79 OutputParams const &) const
81 os << from_ascii(getCmdName()) << "{}";
86 int InsetPagebreak::plaintext(Buffer const &, odocstream & os,
87 OutputParams const &) const
94 int InsetPagebreak::docbook(Buffer const &, odocstream & os,
95 OutputParams const &) const