]> git.lyx.org Git - lyx.git/blob - src/insets/InsetLine.h
Fix bug #12795
[lyx.git] / src / insets / InsetLine.h
1 // -*- C++ -*-
2 /**
3  * \file InsetLine.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Abdelrazak Younes
8  * \author André Pönitz
9  * \author Uwe Stöhr
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef INSET_LINE_H
15 #define INSET_LINE_H
16
17
18 #include "InsetCommand.h"
19
20
21 namespace lyx {
22
23 class InsetLine : public InsetCommand
24 {
25 public:
26         InsetLine(Buffer * buf, InsetCommandParams const &);
27
28         /// InsetCommand inherited methods.
29         //@{
30         docstring screenLabel() const override;
31         static ParamInfo const & findInfo(std::string const &);
32         static std::string defaultCommand() { return "rule"; }
33         static bool isCompatibleCommand(std::string const & s)
34         { return s == "rule"; }
35         //@}
36
37 private:
38
39         /// Inset inherited methods.
40         //@{
41         InsetCode lyxCode() const override { return LINE_CODE; }
42         void docbook(XMLStream &, OutputParams const &) const override;
43         docstring xhtml(XMLStream &, OutputParams const &) const override;
44         bool hasSettings() const override { return true; }
45         void metrics(MetricsInfo &, Dimension &) const override;
46         void draw(PainterInfo & pi, int x, int y) const override;
47         void latex(otexstream &, OutputParams const &) const override;
48         int plaintext(odocstringstream & ods, OutputParams const & op,
49                       size_t max_length = INT_MAX) const override;
50         void doDispatch(Cursor & cur, FuncRequest & cmd) override;
51         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const override;
52         Inset * clone() const override { return new InsetLine(*this); }
53         //@}
54
55         /// cached line height and offset.
56         /// These value are independent of the BufferView size and thus
57         /// can be shared between views.
58         //@{
59         mutable int height_;
60         mutable int offset_;
61         //@}
62 };
63
64
65 } // namespace lyx
66
67 #endif // INSET_NEWLINE_H