4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef INSET_NEWLINE_H
13 #define INSET_NEWLINE_H
20 class InsetNewlineParams
23 /// The different kinds of spaces we support
31 InsetNewlineParams() : kind(NEWLINE) {}
33 void write(std::ostream & os) const;
35 void read(Lexer & lex);
41 class InsetNewline : public Inset
47 explicit InsetNewline(InsetNewlineParams par) : Inset(0)
48 { params_.kind = par.kind; }
50 static void string2params(std::string const &, InsetNewlineParams &);
52 static std::string params2string(InsetNewlineParams const &);
55 InsetCode lyxCode() const { return NEWLINE_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 InsetNewline(*this); }
83 void doDispatch(Cursor & cur, FuncRequest & cmd);
85 bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
88 InsetNewlineParams params_;
94 #endif // INSET_NEWLINE_H