4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef INSET_NEWPAGE_H
13 #define INSET_NEWPAGE_H
20 class InsetNewpageParams
23 /// The different kinds of spaces we support
37 InsetNewpageParams() : kind(NEWPAGE) {}
39 void write(std::ostream & os) const;
41 void read(Lexer & lex);
47 class InsetNewpage : public Inset
53 explicit InsetNewpage(InsetNewpageParams const & par);
55 static void string2params(std::string const &, InsetNewpageParams &);
57 static std::string params2string(InsetNewpageParams const &);
60 InsetCode lyxCode() const override { return NEWPAGE_CODE; }
62 void metrics(MetricsInfo &, Dimension &) const override;
64 void draw(PainterInfo & pi, int x, int y) const override;
66 void latex(otexstream &, OutputParams const &) const override;
68 int plaintext(odocstringstream & ods, OutputParams const & op,
69 size_t max_length = INT_MAX) const override;
71 void docbook(XMLStream &, OutputParams const &) const override;
73 docstring xhtml(XMLStream &, OutputParams const &) const override;
75 void read(Lexer & lex) override;
77 void write(std::ostream & os) const override;
79 int rowFlags() const override { return (params_.kind == InsetNewpageParams::NOPAGEBREAK) ? Inline : Display; }
81 docstring insetLabel() const;
83 ColorCode ColorName() const;
85 std::string contextMenuName() const override;
87 Inset * clone() const override { return new InsetNewpage(*this); }
89 void doDispatch(Cursor & cur, FuncRequest & cmd) override;
91 bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const override;
94 InsetNewpageParams params_;
99 #endif // INSET_NEWPAGE_H