]> git.lyx.org Git - lyx.git/blob - src/insets/InsetSeparator.h
Let the Foot inset have a different Layout when inside a title
[lyx.git] / src / insets / InsetSeparator.h
1 // -*- C++ -*-
2 /**
3  * \file InsetSeparator.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Enrico Forestieri
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef INSET_SEPARATOR_H
13 #define INSET_SEPARATOR_H
14
15 #include "Inset.h"
16
17
18 namespace lyx {
19
20 class InsetSeparatorParams
21 {
22 public:
23         /// The different kinds of separators we support
24         enum Kind {
25                 ///
26                 PLAIN,
27                 ///
28                 PARBREAK
29         };
30         ///
31         InsetSeparatorParams() : kind(PLAIN) {}
32         ///
33         void write(std::ostream & os) const;
34         ///
35         void read(Lexer & lex);
36         ///
37         Kind kind;
38 };
39
40
41 class InsetSeparator : public Inset
42 {
43 public:
44         ///
45         InsetSeparator();
46         ///
47         explicit InsetSeparator(InsetSeparatorParams const & par);
48         ///
49         static void string2params(std::string const &, InsetSeparatorParams &);
50         ///
51         static std::string params2string(InsetSeparatorParams const &);
52 private:
53         ///
54         InsetSeparatorParams params() const { return params_; }
55         ///
56         InsetCode lyxCode() const { return SEPARATOR_CODE; }
57         ///
58         void metrics(MetricsInfo &, Dimension &) const;
59         ///
60         void draw(PainterInfo & pi, int x, int y) const;
61         ///
62         void latex(otexstream &, OutputParams const &) const;
63         ///
64         int plaintext(odocstringstream & ods, OutputParams const & op,
65                       size_t max_length = INT_MAX) const;
66         ///
67         int docbook(odocstream &, OutputParams const &) const;
68         ///
69         docstring xhtml(XHTMLStream &, OutputParams const &) const;
70         ///
71         void read(Lexer & lex);
72         ///
73         void write(std::ostream & os) const;
74         /// is this equivalent to a space (which is BTW different from
75         /// a line separator)?
76         bool isSpace() const { return true; }
77         ///
78         ColorCode ColorName() const;
79         ///
80         std::string contextMenuName() const;
81         ///
82         Inset * clone() const { return new InsetSeparator(*this); }
83         ///
84         void doDispatch(Cursor & cur, FuncRequest & cmd);
85         ///
86         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
87
88         ///
89         InsetSeparatorParams params_;
90 };
91
92
93 } // namespace lyx
94
95 #endif // INSET_SEPARATOR_H