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
16 #include "MailInset.h"
18 #include "support/docstring.h"
19 #include "support/gettext.h"
24 class InsetNewpageParams {
26 /// The different kinds of spaces we support
38 InsetNewpageParams() : kind(NEWPAGE) {}
40 void write(std::ostream & os) const;
42 void read(Lexer & lex);
48 class InsetNewpage : public Inset
56 InsetNewpage(InsetNewpageParams par);
58 InsetNewpageParams params() const { return params_; }
60 InsetCode lyxCode() const { return NEWPAGE_CODE; }
62 void metrics(MetricsInfo &, Dimension &) const;
64 void draw(PainterInfo & pi, int x, int y) const;
66 int latex(odocstream &, OutputParams const &) const;
68 int plaintext(odocstream &, OutputParams const &) const;
70 int docbook(odocstream &, OutputParams const &) const;
72 void read(Lexer & lex);
74 void write(std::ostream & os) const;
76 DisplayType display() const { return AlignCenter; }
78 docstring insetLabel() const;
80 ColorCode ColorName() const;
82 virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
85 Inset * clone() const { return new InsetNewpage(*this); }
87 void doDispatch(Cursor & cur, FuncRequest & cmd);
89 bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
91 InsetNewpageParams params_;
95 class InsetNewpageMailer : public MailInset {
98 InsetNewpageMailer(InsetNewpage & inset);
100 virtual Inset & inset() const { return inset_; }
102 virtual std::string const & name() const { return name_; }
104 virtual std::string const inset2string(Buffer const &) const;
106 static void string2params(std::string const &, InsetNewpageParams &);
108 static std::string const params2string(InsetNewpageParams const &);
111 static std::string const name_;
113 InsetNewpage & inset_;
118 #endif // INSET_NEWPAGE_H