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 RowFlags rowFlags() const { return BreakAfter | RowAfter; }
52 static void string2params(std::string const &, InsetNewlineParams &);
54 static std::string params2string(InsetNewlineParams const &);
57 InsetCode lyxCode() const { return NEWLINE_CODE; }
59 void metrics(MetricsInfo &, Dimension &) const;
61 void draw(PainterInfo & pi, int x, int y) const;
63 void latex(otexstream &, OutputParams const &) const;
65 int plaintext(odocstringstream & ods, OutputParams const & op,
66 size_t max_length = INT_MAX) const;
68 void docbook(XMLStream &, OutputParams const &) const;
70 docstring xhtml(XMLStream &, OutputParams const &) const;
72 void read(Lexer & lex);
74 void write(std::ostream & os) const;
75 /// is this equivalent to a space (which is BTW different from
76 /// a line separator)?
77 bool isSpace() const { return true; }
79 ColorCode ColorName() const;
81 std::string contextMenuName() const;
83 Inset * clone() const { return new InsetNewline(*this); }
85 void doDispatch(Cursor & cur, FuncRequest & cmd);
87 bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
90 InsetNewlineParams params_;
96 #endif // INSET_NEWLINE_H