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-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.
|
|
|
|
//@{
|
2020-10-01 07:42:11 +00:00
|
|
|
docstring screenLabel() const override;
|
2010-09-07 00:41:00 +00:00
|
|
|
static ParamInfo const & findInfo(std::string const &);
|
2013-05-12 11:00:02 +00:00
|
|
|
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.
|
|
|
|
//@{
|
2020-10-01 07:42:11 +00:00
|
|
|
InsetCode lyxCode() const override { return LINE_CODE; }
|
|
|
|
void docbook(XMLStream &, OutputParams const &) const override;
|
|
|
|
docstring xhtml(XMLStream &, OutputParams const &) const override;
|
|
|
|
bool hasSettings() const override { return true; }
|
|
|
|
void metrics(MetricsInfo &, Dimension &) const override;
|
|
|
|
void draw(PainterInfo & pi, int x, int y) const override;
|
|
|
|
void latex(otexstream &, OutputParams const &) const override;
|
2013-03-08 19:52:18 +00:00
|
|
|
int plaintext(odocstringstream & ods, OutputParams const & op,
|
2020-10-01 07:42:11 +00:00
|
|
|
size_t max_length = INT_MAX) const override;
|
|
|
|
void doDispatch(Cursor & cur, FuncRequest & cmd) override;
|
|
|
|
bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const override;
|
|
|
|
Inset * clone() const override { 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
|