* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author André Pönitz
+ * \author André Pönitz
*
* Full author contact details are available in file CREDITS.
*/
#define INSET_NEWPAGE_H
#include "Inset.h"
-#include "MailInset.h"
-
-#include "support/docstring.h"
-#include "support/gettext.h"
namespace lyx {
-class InsetNewpageParams {
+class InsetNewpageParams
+{
public:
/// The different kinds of spaces we support
enum Kind {
///
CLEARPAGE,
///
- CLEARDOUBLEPAGE
+ CLEARDOUBLEPAGE,
+ ///
+ NOPAGEBREAK
};
///
InsetNewpageParams() : kind(NEWPAGE) {}
public:
///
InsetNewpage();
-
///
- explicit
- InsetNewpage(InsetNewpageParams par);
+ explicit InsetNewpage(InsetNewpageParams const & par);
///
- InsetNewpageParams params() const { return params_; }
+ static void string2params(std::string const &, InsetNewpageParams &);
///
- InsetCode lyxCode() const { return NEWPAGE_CODE; }
+ static std::string params2string(InsetNewpageParams const &);
+private:
///
- void metrics(MetricsInfo &, Dimension &) const;
+ InsetCode lyxCode() const override { return NEWPAGE_CODE; }
///
- void draw(PainterInfo & pi, int x, int y) const;
+ void metrics(MetricsInfo &, Dimension &) const override;
///
- int latex(odocstream &, OutputParams const &) const;
+ void draw(PainterInfo & pi, int x, int y) const override;
///
- int plaintext(odocstream &, OutputParams const &) const;
+ void latex(otexstream &, OutputParams const &) const override;
///
- int docbook(odocstream &, OutputParams const &) const;
+ int plaintext(odocstringstream & ods, OutputParams const & op,
+ size_t max_length = INT_MAX) const override;
///
- void read(Lexer & lex);
+ void docbook(XMLStream &, OutputParams const &) const override;
///
- void write(std::ostream & os) const;
+ docstring xhtml(XMLStream &, OutputParams const &) const override;
+ ///
+ void read(Lexer & lex) override;
+ ///
+ void write(std::ostream & os) const override;
///
- DisplayType display() const { return AlignCenter; }
+ int rowFlags() const override { return (params_.kind == InsetNewpageParams::NOPAGEBREAK) ? Inline : Display; }
///
docstring insetLabel() const;
///
ColorCode ColorName() const;
///
- virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
-private:
- ///
- Inset * clone() const { return new InsetNewpage(*this); }
+ std::string contextMenuName() const override;
///
- void doDispatch(Cursor & cur, FuncRequest & cmd);
+ Inset * clone() const override { return new InsetNewpage(*this); }
///
- bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
+ void doDispatch(Cursor & cur, FuncRequest & cmd) override;
///
- InsetNewpageParams params_;
-};
-
+ bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const override;
-class InsetNewpageMailer : public MailInset {
-public:
- ///
- InsetNewpageMailer(InsetNewpage & inset);
- ///
- virtual Inset & inset() const { return inset_; }
- ///
- virtual std::string const & name() const { return name_; }
- ///
- virtual std::string const inset2string(Buffer const &) const;
///
- static void string2params(std::string const &, InsetNewpageParams &);
- ///
- static std::string const params2string(InsetNewpageParams const &);
-private:
- ///
- static std::string const name_;
- ///
- InsetNewpage & inset_;
+ InsetNewpageParams params_;
};
} // namespace lyx