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