]> git.lyx.org Git - lyx.git/blob - src/insets/InsetLine.h
prepare Qt 5.6 builds
[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 LaTeXFeatures;
24
25 class InsetLine : public InsetCommand
26 {
27 public:
28         InsetLine(Buffer * buf, InsetCommandParams const &);
29
30         /// InsetCommand inherited methods.
31         //@{
32         docstring screenLabel() const;
33         static ParamInfo const & findInfo(std::string const &);
34         static std::string defaultCommand() { return "rule"; }
35         static bool isCompatibleCommand(std::string const & s)
36         { return s == "rule"; }
37         //@}
38
39 private:
40
41         /// Inset inherited methods.
42         //@{
43         InsetCode lyxCode() const { return LINE_CODE; }
44         Dimension const dimension(BufferView const &) const;
45         int docbook(odocstream &, OutputParams const &) const;
46         /// Does nothing at the moment.
47         docstring xhtml(XHTMLStream &, OutputParams const &) const;
48         bool hasSettings() const { return true; }
49         void metrics(MetricsInfo &, Dimension &) const;
50         void draw(PainterInfo & pi, int x, int y) const;
51         void latex(otexstream &, OutputParams const &) const;
52         int plaintext(odocstringstream & ods, OutputParams const & op,
53                       size_t max_length = INT_MAX) const;
54         void doDispatch(Cursor & cur, FuncRequest & cmd);
55         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
56         Inset * clone() const { return new InsetLine(*this); }
57         //@}
58
59         /// cached line height and offset.
60         /// These value are independent of the BufferView size and thus
61         /// can be shared between views.
62         //@{
63         mutable int height_;
64         mutable int offset_;
65         //@}
66 };
67
68
69 } // namespace lyx
70
71 #endif // INSET_NEWLINE_H