]> git.lyx.org Git - lyx.git/blob - src/insets/InsetNewpage.h
Do not check again and again for non existing files
[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         void latex(otexstream &, OutputParams const &) const;
67         ///
68         int plaintext(odocstringstream & ods, OutputParams const & op,
69                       size_t max_length = INT_MAX) const;
70         ///
71         int docbook(odocstream &, OutputParams const &) const;
72         ///
73         docstring xhtml(XHTMLStream &, OutputParams const &) const;
74         ///
75         void read(Lexer & lex);
76         ///
77         void write(std::ostream & os) const;
78         ///
79         DisplayType display() const { return AlignCenter; }
80         ///
81         docstring insetLabel() const;
82         ///
83         ColorCode ColorName() const;
84         ///
85         std::string contextMenuName() const;
86         ///
87         Inset * clone() const { return new InsetNewpage(*this); }
88         ///
89         void doDispatch(Cursor & cur, FuncRequest & cmd);
90         ///
91         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
92
93         ///
94         InsetNewpageParams params_;
95 };
96
97 } // namespace lyx
98
99 #endif // INSET_NEWPAGE_H