2003-03-12 19:16:42 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-04-25 01:24:38 +00:00
|
|
|
* \file InsetNewline.h
|
2003-03-12 19:16:42 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author John Levon
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-03-12 19:16:42 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INSET_NEWLINE_H
|
|
|
|
#define INSET_NEWLINE_H
|
|
|
|
|
|
|
|
|
2007-04-29 13:39:47 +00:00
|
|
|
#include "Inset.h"
|
2003-03-12 19:16:42 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
2007-04-29 13:39:47 +00:00
|
|
|
class InsetNewline : public Inset {
|
2003-03-12 19:16:42 +00:00
|
|
|
public:
|
|
|
|
|
2003-05-19 17:03:12 +00:00
|
|
|
InsetNewline() {}
|
2003-03-12 19:16:42 +00:00
|
|
|
|
2007-04-29 13:39:47 +00:00
|
|
|
Inset::Code lyxCode() const { return Inset::NEWLINE_CODE; }
|
2003-03-12 19:16:42 +00:00
|
|
|
|
2006-11-28 15:15:49 +00:00
|
|
|
bool metrics(MetricsInfo &, Dimension &) const;
|
2003-03-12 19:16:42 +00:00
|
|
|
|
2003-05-30 06:48:24 +00:00
|
|
|
virtual void draw(PainterInfo & pi, int x, int y) const;
|
2003-03-12 19:16:42 +00:00
|
|
|
|
2007-02-15 22:27:45 +00:00
|
|
|
int latex(Buffer const &, odocstream &, OutputParams const &) const;
|
2003-03-12 19:16:42 +00:00
|
|
|
|
2007-02-15 22:27:45 +00:00
|
|
|
int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
|
2003-03-12 19:16:42 +00:00
|
|
|
|
2007-02-15 22:27:45 +00:00
|
|
|
int docbook(Buffer const &, odocstream &, OutputParams const &) const;
|
2003-03-12 19:16:42 +00:00
|
|
|
|
2007-04-26 11:30:54 +00:00
|
|
|
virtual void read(Buffer const &, Lexer & lex);
|
2003-03-12 19:16:42 +00:00
|
|
|
|
2003-08-28 07:41:31 +00:00
|
|
|
virtual void write(Buffer const & buf, std::ostream & os) const;
|
2003-03-12 19:16:42 +00:00
|
|
|
/// We don't need \begin_inset and \end_inset
|
|
|
|
virtual bool directWrite() const { return true; }
|
2004-02-20 10:32:44 +00:00
|
|
|
/// is this equivalent to a space (which is BTW different from
|
|
|
|
// a line separator)?
|
|
|
|
bool isSpace() const;
|
2004-11-23 23:04:52 +00:00
|
|
|
private:
|
2007-04-29 13:39:47 +00:00
|
|
|
virtual std::auto_ptr<Inset> doClone() const
|
2004-11-23 23:04:52 +00:00
|
|
|
{
|
2007-04-29 13:39:47 +00:00
|
|
|
return std::auto_ptr<Inset>(new InsetNewline);
|
2004-11-23 23:04:52 +00:00
|
|
|
}
|
2003-03-12 19:16:42 +00:00
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2003-03-12 19:16:42 +00:00
|
|
|
#endif // INSET_NEWLINE_H
|