]> git.lyx.org Git - lyx.git/blob - src/insets/InsetLine.h
InsetLine: Fix vertical positioning, offset is really an offset from the
[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 André Pönitz
8  * \author Uwe Stöhr
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef INSET_LINE_H
14 #define INSET_LINE_H
15
16
17 #include "InsetCommand.h"
18
19
20 namespace lyx {
21
22 class LaTeXFeatures;
23
24 class InsetLine : public InsetCommand
25 {
26 public:
27         InsetLine(Buffer * buf, InsetCommandParams const &);
28
29         /// InsetCommand inherited methods.
30         //@{
31         docstring screenLabel() const;
32         static ParamInfo const & findInfo(std::string const &);
33         static std::string defaultCommand() { return "rule"; };
34         static bool isCompatibleCommand(std::string const & s)
35         { return s == "rule"; }
36         //@}
37
38 private:
39
40         /// Inset inherited methods.
41         //@{
42         InsetCode lyxCode() const { return LINE_CODE; }
43         Dimension const dimension(BufferView const &) const;
44         int docbook(odocstream &, OutputParams const &) const;
45         /// Does nothing at the moment.
46         docstring xhtml(XHTMLStream &, OutputParams const &) const;
47         bool hasSettings() const { return true; }
48         void metrics(MetricsInfo &, Dimension &) const;
49         void draw(PainterInfo & pi, int x, int y) const;
50         int latex(odocstream &, OutputParams const &) const;
51         int plaintext(odocstream &, OutputParams const &) const;
52         void doDispatch(Cursor & cur, FuncRequest & cmd);
53         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
54         Inset * clone() const { return new InsetLine(*this); }
55         //@}
56
57         /// cached line height and offset.
58         /// These value are independent of the BufferView size and thus
59         /// can be shared between views.
60         //@{
61         mutable int height_;
62         mutable int offset_;
63         //@}
64 };
65
66
67 } // namespace lyx
68
69 #endif // INSET_NEWLINE_H