X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetLine.h;h=8285045ec56ac77a8bece1a9053e10f6e3bc46dc;hb=667560114752e668fbd59123faf9d454da632fb0;hp=b14c899b80504edc3fb5ae15bf818fd954e78307;hpb=f61bebd7fb25beabdf0dc761520030f9059499d6;p=lyx.git diff --git a/src/insets/InsetLine.h b/src/insets/InsetLine.h index b14c899b80..8285045ec5 100644 --- a/src/insets/InsetLine.h +++ b/src/insets/InsetLine.h @@ -4,7 +4,9 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * + * \author Abdelrazak Younes * \author André Pönitz + * \author Uwe Stöhr * * Full author contact details are available in file CREDITS. */ @@ -13,41 +15,54 @@ #define INSET_LINE_H -#include "Inset.h" +#include "InsetCommand.h" namespace lyx { -class InsetLine : public Inset { +class LaTeXFeatures; + +class InsetLine : public InsetCommand +{ public: - /// - InsetLine() {} - /// + InsetLine(Buffer * buf, InsetCommandParams const &); + + /// InsetCommand inherited methods. + //@{ + docstring screenLabel() const; + static ParamInfo const & findInfo(std::string const &); + static std::string defaultCommand() { return "rule"; } + static bool isCompatibleCommand(std::string const & s) + { return s == "rule"; } + //@} + +private: + + /// 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; } void metrics(MetricsInfo &, Dimension &) const; - /// void draw(PainterInfo & pi, int x, int y) const; - /// - int latex(odocstream &, OutputParams const &) const; - /// - int plaintext(odocstream &, OutputParams const &) const; - /// - int docbook(odocstream &, OutputParams const &) const; - /// - int xhtml(odocstream &, OutputParams const &) const; - /// - void read(Lexer & lex); - /// - void write(std::ostream & os) const; - /// We don't need \begin_inset and \end_inset - bool directWrite() const { return true; } - /// - DisplayType display() const { return AlignCenter; } - /// - void validate(LaTeXFeatures & features) const; -private: + void latex(otexstream &, OutputParams const &) const; + int plaintext(odocstringstream & ods, OutputParams const & op, + size_t max_length = INT_MAX) const; + void doDispatch(Cursor & cur, FuncRequest & cmd); + bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const; Inset * clone() const { return new InsetLine(*this); } + //@} + + /// cached line height and offset. + /// These value are independent of the BufferView size and thus + /// can be shared between views. + //@{ + mutable int height_; + mutable int offset_; + //@} };