]> git.lyx.org Git - lyx.git/blob - src/insets/InsetNewpage.h
Get rid of Qt resources
[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         InsetCode lyxCode() const { return NEWPAGE_CODE; }
59         ///
60         void metrics(MetricsInfo &, Dimension &) const;
61         ///
62         void draw(PainterInfo & pi, int x, int y) const;
63         ///
64         void latex(otexstream &, OutputParams const &) const;
65         ///
66         int plaintext(odocstringstream & ods, OutputParams const & op,
67                       size_t max_length = INT_MAX) const;
68         ///
69         int docbook(odocstream &, OutputParams const &) const;
70         ///
71         docstring xhtml(XHTMLStream &, OutputParams const &) const;
72         ///
73         void read(Lexer & lex);
74         ///
75         void write(std::ostream & os) const;
76         ///
77         DisplayType display() const { return AlignCenter; }
78         ///
79         docstring insetLabel() const;
80         ///
81         ColorCode ColorName() const;
82         ///
83         std::string contextMenuName() const;
84         ///
85         Inset * clone() const { return new InsetNewpage(*this); }
86         ///
87         void doDispatch(Cursor & cur, FuncRequest & cmd);
88         ///
89         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
90
91         ///
92         InsetNewpageParams params_;
93 };
94
95 } // namespace lyx
96
97 #endif // INSET_NEWPAGE_H