]> git.lyx.org Git - lyx.git/blob - src/insets/InsetNewpage.h
Fix bug #6315: counters in insets that don't produce output have ghost values.
[lyx.git] / src / insets / InsetNewpage.h
1 // -*- C++ -*-
2 /**
3  * \file InsetNewpage.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author André Pönitz
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef INSET_NEWPAGE_H
13 #define INSET_NEWPAGE_H
14
15 #include "Inset.h"
16
17
18 namespace lyx {
19
20 class InsetNewpageParams
21 {
22 public:
23         /// The different kinds of spaces we support
24         enum Kind {
25                 ///
26                 NEWPAGE,
27                 ///
28                 PAGEBREAK,
29                 ///
30                 CLEARPAGE,
31                 ///
32                 CLEARDOUBLEPAGE
33         };
34         ///
35         InsetNewpageParams() : kind(NEWPAGE) {}
36         ///
37         void write(std::ostream & os) const;
38         ///
39         void read(Lexer & lex);
40         ///
41         Kind kind;
42 };
43
44
45 class InsetNewpage : public Inset
46 {
47 public:
48         ///
49         InsetNewpage();
50         ///
51         explicit InsetNewpage(InsetNewpageParams const & par);
52         ///
53         static void string2params(std::string const &, InsetNewpageParams &);
54         ///
55         static std::string params2string(InsetNewpageParams const &);
56 private:
57         ///
58         InsetNewpageParams params() const { return params_; }
59         ///
60         InsetCode lyxCode() const { return NEWPAGE_CODE; }
61         ///
62         void metrics(MetricsInfo &, Dimension &) const;
63         ///
64         void draw(PainterInfo & pi, int x, int y) const;
65         ///
66         int latex(odocstream &, OutputParams const &) const;
67         ///
68         int plaintext(odocstream &, OutputParams const &) const;
69         ///
70         int docbook(odocstream &, OutputParams const &) const;
71         ///
72         docstring xhtml(XHTMLStream &, OutputParams const &) const;
73         ///
74         void read(Lexer & lex);
75         ///
76         void write(std::ostream & os) const;
77         ///
78         DisplayType display() const { return AlignCenter; }
79         ///
80         docstring insetLabel() const;
81         ///
82         ColorCode ColorName() const;
83         ///
84         docstring contextMenu(BufferView const & bv, int x, int y) const;
85         ///
86         Inset * clone() const { return new InsetNewpage(*this); }
87         ///
88         void doDispatch(Cursor & cur, FuncRequest & cmd);
89         ///
90         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
91
92         ///
93         InsetNewpageParams params_;
94 };
95
96 } // namespace lyx
97
98 #endif // INSET_NEWPAGE_H