2003-10-27 12:41:26 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-04-25 01:24:38 +00:00
|
|
|
* \file InsetLine.h
|
2003-10-27 12:41:26 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2010-09-17 01:28:08 +00:00
|
|
|
* \author Abdelrazak Younes
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2010-09-07 00:41:00 +00:00
|
|
|
* \author Uwe Stöhr
|
2003-10-27 12:41:26 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INSET_LINE_H
|
|
|
|
#define INSET_LINE_H
|
|
|
|
|
|
|
|
|
2010-09-07 00:41:00 +00:00
|
|
|
#include "InsetCommand.h"
|
2003-10-27 12:41:26 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
2010-09-07 00:41:00 +00:00
|
|
|
class LaTeXFeatures;
|
|
|
|
|
2010-09-16 10:14:46 +00:00
|
|
|
class InsetLine : public InsetCommand
|
|
|
|
{
|
2003-10-27 12:41:26 +00:00
|
|
|
public:
|
2010-09-07 00:41:00 +00:00
|
|
|
InsetLine(Buffer * buf, InsetCommandParams const &);
|
2010-09-16 10:14:46 +00:00
|
|
|
|
|
|
|
/// InsetCommand inherited methods.
|
|
|
|
//@{
|
2010-09-07 00:41:00 +00:00
|
|
|
docstring screenLabel() const;
|
|
|
|
static ParamInfo const & findInfo(std::string const &);
|
|
|
|
static std::string defaultCommand() { return "rule"; };
|
2010-09-15 12:43:07 +00:00
|
|
|
static bool isCompatibleCommand(std::string const & s)
|
2010-09-16 10:14:46 +00:00
|
|
|
{ return s == "rule"; }
|
|
|
|
//@}
|
2010-09-15 12:43:07 +00:00
|
|
|
|
2010-09-07 00:41:00 +00:00
|
|
|
private:
|
2010-09-16 10:14:46 +00:00
|
|
|
|
|
|
|
/// Inset inherited methods.
|
|
|
|
//@{
|
|
|
|
InsetCode lyxCode() const { return LINE_CODE; }
|
|
|
|
Dimension const dimension(BufferView const &) const;
|
|
|
|
int docbook(odocstream &, OutputParams const &) const;
|
|
|
|
/// Does nothing at the moment.
|
|
|
|
docstring xhtml(XHTMLStream &, OutputParams const &) const;
|
|
|
|
bool hasSettings() const { return true; }
|
2007-09-21 20:39:47 +00:00
|
|
|
void metrics(MetricsInfo &, Dimension &) const;
|
2003-10-27 12:41:26 +00:00
|
|
|
void draw(PainterInfo & pi, int x, int y) const;
|
2011-02-10 20:02:48 +00:00
|
|
|
void latex(otexstream &, OutputParams const &) const;
|
2008-02-27 20:43:16 +00:00
|
|
|
int plaintext(odocstream &, OutputParams const &) const;
|
2010-09-07 00:41:00 +00:00
|
|
|
void doDispatch(Cursor & cur, FuncRequest & cmd);
|
|
|
|
bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
|
2008-02-29 20:16:04 +00:00
|
|
|
Inset * clone() const { return new InsetLine(*this); }
|
2010-09-16 10:14:46 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/// cached line height and offset.
|
|
|
|
/// These value are independent of the BufferView size and thus
|
|
|
|
/// can be shared between views.
|
|
|
|
//@{
|
2010-09-16 07:36:20 +00:00
|
|
|
mutable int height_;
|
|
|
|
mutable int offset_;
|
2010-09-16 10:14:46 +00:00
|
|
|
//@}
|
2003-10-27 12:41:26 +00:00
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2003-10-27 12:41:26 +00:00
|
|
|
#endif // INSET_NEWLINE_H
|