2003-10-27 12:41:26 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/**
|
2007-11-23 02:10:00 +00:00
|
|
|
|
* \file InsetNewpage.h
|
2003-10-27 12:41:26 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
2007-11-23 02:10:00 +00:00
|
|
|
|
#ifndef INSET_NEWPAGE_H
|
|
|
|
|
#define INSET_NEWPAGE_H
|
2003-10-27 12:41:26 +00:00
|
|
|
|
|
2007-04-29 13:39:47 +00:00
|
|
|
|
#include "Inset.h"
|
2003-10-27 12:41:26 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
2008-03-27 22:26:24 +00:00
|
|
|
|
class InsetNewpageParams
|
|
|
|
|
{
|
2008-03-25 09:26:03 +00:00
|
|
|
|
public:
|
|
|
|
|
/// The different kinds of spaces we support
|
|
|
|
|
enum Kind {
|
|
|
|
|
///
|
|
|
|
|
NEWPAGE,
|
|
|
|
|
///
|
|
|
|
|
PAGEBREAK,
|
|
|
|
|
///
|
|
|
|
|
CLEARPAGE,
|
|
|
|
|
///
|
|
|
|
|
CLEARDOUBLEPAGE
|
|
|
|
|
};
|
|
|
|
|
///
|
|
|
|
|
InsetNewpageParams() : kind(NEWPAGE) {}
|
|
|
|
|
///
|
|
|
|
|
void write(std::ostream & os) const;
|
|
|
|
|
///
|
|
|
|
|
void read(Lexer & lex);
|
|
|
|
|
///
|
|
|
|
|
Kind kind;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2008-03-15 00:02:41 +00:00
|
|
|
|
class InsetNewpage : public Inset
|
|
|
|
|
{
|
2003-10-27 12:41:26 +00:00
|
|
|
|
public:
|
2008-03-15 00:02:41 +00:00
|
|
|
|
///
|
2008-03-25 09:26:03 +00:00
|
|
|
|
InsetNewpage();
|
|
|
|
|
///
|
2008-03-27 22:26:24 +00:00
|
|
|
|
explicit InsetNewpage(InsetNewpageParams const & par);
|
|
|
|
|
///
|
|
|
|
|
static void string2params(std::string const &, InsetNewpageParams &);
|
|
|
|
|
///
|
|
|
|
|
static std::string params2string(InsetNewpageParams const &);
|
|
|
|
|
private:
|
2008-03-25 09:26:03 +00:00
|
|
|
|
///
|
|
|
|
|
InsetNewpageParams params() const { return params_; }
|
2008-03-15 00:02:41 +00:00
|
|
|
|
///
|
2007-11-23 02:10:00 +00:00
|
|
|
|
InsetCode lyxCode() const { return NEWPAGE_CODE; }
|
2008-03-15 00:02:41 +00:00
|
|
|
|
///
|
2007-09-21 20:39:47 +00:00
|
|
|
|
void metrics(MetricsInfo &, Dimension &) const;
|
2008-03-15 00:02:41 +00:00
|
|
|
|
///
|
2003-10-27 12:41:26 +00:00
|
|
|
|
void draw(PainterInfo & pi, int x, int y) const;
|
2008-03-15 00:02:41 +00:00
|
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
|
int latex(odocstream &, OutputParams const &) const;
|
2008-03-15 00:02:41 +00:00
|
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
|
int plaintext(odocstream &, OutputParams const &) const;
|
2008-03-15 00:02:41 +00:00
|
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
|
int docbook(odocstream &, OutputParams const &) const;
|
2008-03-15 00:02:41 +00:00
|
|
|
|
///
|
2008-03-25 09:26:03 +00:00
|
|
|
|
void read(Lexer & lex);
|
2008-03-15 00:02:41 +00:00
|
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
|
void write(std::ostream & os) const;
|
2008-03-15 00:02:41 +00:00
|
|
|
|
///
|
2007-05-18 14:32:29 +00:00
|
|
|
|
DisplayType display() const { return AlignCenter; }
|
2008-03-15 00:02:41 +00:00
|
|
|
|
///
|
2008-03-25 09:26:03 +00:00
|
|
|
|
docstring insetLabel() const;
|
2008-03-15 00:02:41 +00:00
|
|
|
|
///
|
2008-03-25 09:26:03 +00:00
|
|
|
|
ColorCode ColorName() const;
|
2008-03-15 00:02:41 +00:00
|
|
|
|
///
|
2008-03-27 22:26:24 +00:00
|
|
|
|
docstring contextMenu(BufferView const & bv, int x, int y) const;
|
2008-03-15 00:02:41 +00:00
|
|
|
|
///
|
2008-02-29 20:17:28 +00:00
|
|
|
|
Inset * clone() const { return new InsetNewpage(*this); }
|
2008-03-15 00:02:41 +00:00
|
|
|
|
///
|
2008-03-25 09:26:03 +00:00
|
|
|
|
void doDispatch(Cursor & cur, FuncRequest & cmd);
|
2008-03-15 00:02:41 +00:00
|
|
|
|
///
|
2008-03-25 09:26:03 +00:00
|
|
|
|
bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
2008-03-15 00:02:41 +00:00
|
|
|
|
///
|
2008-03-27 22:26:24 +00:00
|
|
|
|
InsetNewpageParams params_;
|
2006-11-25 15:09:01 +00:00
|
|
|
|
};
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2007-11-23 02:10:00 +00:00
|
|
|
|
#endif // INSET_NEWPAGE_H
|