]> git.lyx.org Git - lyx.git/blob - src/insets/InsetLine.h
60b558e52e2f17a0a7f0ef7d78bcb558b62b9006
[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         ///
34         static ParamInfo const & findInfo(std::string const &);
35         ///
36         static std::string defaultCommand() { return "rule"; };
37         ///
38         static bool isCompatibleCommand(std::string const & s)
39         { return s == "rule"; }
40         //@}
41
42 private:
43
44         /// Inset inherited methods.
45         //@{
46         InsetCode lyxCode() const { return LINE_CODE; }
47         ///
48         Dimension const dimension(BufferView const &) const;
49         ///
50         int docbook(odocstream &, OutputParams const &) const;
51         /// Does nothing at the moment.
52         docstring xhtml(XHTMLStream &, OutputParams const &) const;
53         ///
54         bool hasSettings() const { return true; }
55         ///
56         void metrics(MetricsInfo &, Dimension &) const;
57         ///
58         void draw(PainterInfo & pi, int x, int y) const;
59         ///
60         int latex(odocstream &, OutputParams const &) const;
61         ///
62         int plaintext(odocstream &, OutputParams const &) const;
63         ///
64         void doDispatch(Cursor & cur, FuncRequest & cmd);
65         ///
66         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
67         ///
68         Inset * clone() const { return new InsetLine(*this); }
69         //@}
70
71         /// cached line height and offset.
72         /// These value are independent of the BufferView size and thus
73         /// can be shared between views.
74         //@{
75         mutable int height_;
76         mutable int offset_;
77         //@}
78 };
79
80
81 } // namespace lyx
82
83 #endif // INSET_NEWLINE_H