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
31 InsetSeparatorParams() : kind(PLAIN) {}
33 void write(std::ostream & os) const;
35 void read(Lexer & lex);
41 class InsetSeparator : public Inset
47 explicit InsetSeparator(InsetSeparatorParams const & par);
49 static void string2params(std::string const &, InsetSeparatorParams &);
51 static std::string params2string(InsetSeparatorParams const &);
54 InsetSeparatorParams params() const { return params_; }
56 InsetCode lyxCode() const { return SEPARATOR_CODE; }
58 void metrics(MetricsInfo &, Dimension &) const;
60 void draw(PainterInfo & pi, int x, int y) const;
62 void latex(otexstream &, OutputParams const &) const;
64 int plaintext(odocstringstream & ods, OutputParams const & op,
65 size_t max_length = INT_MAX) const;
67 int docbook(odocstream &, OutputParams const &) const;
69 docstring xhtml(XHTMLStream &, OutputParams const &) const;
71 void read(Lexer & lex);
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; }
78 ColorCode ColorName() const;
80 std::string contextMenuName() const;
82 Inset * clone() const { return new InsetSeparator(*this); }
84 void doDispatch(Cursor & cur, FuncRequest & cmd);
86 bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
89 InsetSeparatorParams params_;
95 #endif // INSET_SEPARATOR_H