3 * \file InsetSeparator.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Enrico Forestieri
9 * Full author contact details are available in file CREDITS.
12 #ifndef INSET_SEPARATOR_H
13 #define INSET_SEPARATOR_H
20 class InsetSeparatorParams
23 /// The different kinds of separators we support
30 InsetSeparatorParams() : kind(PLAIN) {}
32 void write(std::ostream & os) const;
34 void read(Lexer & lex);
40 class InsetSeparator : public Inset
46 explicit InsetSeparator(InsetSeparatorParams const & par);
48 static void string2params(std::string const &, InsetSeparatorParams &);
50 static std::string params2string(InsetSeparatorParams const &);
53 InsetSeparatorParams params() const { return params_; }
55 InsetCode lyxCode() const { return SEPARATOR_CODE; }
57 void metrics(MetricsInfo &, Dimension &) const;
59 void draw(PainterInfo & pi, int x, int y) const;
61 void latex(otexstream &, OutputParams const &) const;
63 int plaintext(odocstringstream & ods, OutputParams const & op,
64 size_t max_length = INT_MAX) const;
66 int docbook(odocstream &, OutputParams const &) const;
68 docstring xhtml(XHTMLStream &, OutputParams const &) const;
70 void read(Lexer & lex);
72 void write(std::ostream & os) const;
73 /// is this equivalent to a space (which is BTW different from
74 /// a line separator)?
75 bool isSpace() const { return true; }
77 ColorCode ColorName() const;
79 std::string contextMenuName() const;
81 Inset * clone() const { return new InsetSeparator(*this); }
83 void doDispatch(Cursor & cur, FuncRequest & cmd);
85 bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
88 InsetSeparatorParams params_;
94 #endif // INSET_SEPARATOR_H