]> git.lyx.org Git - lyx.git/blob - src/insets/insethfill.C
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / insethfill.C
1 /**
2  * \file insethfill.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author André Pönitz
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "insethfill.h"
14 #include "gettext.h"
15
16 #include "support/std_ostream.h"
17
18
19 namespace lyx {
20
21 using std::ostream;
22
23
24 InsetHFill::InsetHFill()
25         : InsetCommand(InsetCommandParams("hfill"), std::string())
26 {}
27
28
29 std::auto_ptr<InsetBase> InsetHFill::doClone() const
30 {
31         return std::auto_ptr<InsetBase>(new InsetHFill);
32 }
33
34
35 bool InsetHFill::metrics(MetricsInfo &, Dimension & dim) const
36 {
37         dim.wid = 3;
38         dim.asc = 3;
39         dim.des = 3;
40         bool const changed = dim_ != dim;
41         dim_ = dim;
42         return changed;
43 }
44
45
46 docstring const InsetHFill::getScreenLabel(Buffer const &) const
47 {
48         return _("Horizontal Fill");
49 }
50
51
52 int InsetHFill::plaintext(Buffer const &, odocstream & os,
53                       OutputParams const &) const
54 {
55         os << '\t';
56         return 0;
57 }
58
59
60 int InsetHFill::docbook(Buffer const &, odocstream & os,
61                         OutputParams const &) const
62 {
63         os << '\n';
64         return 0;
65 }
66
67
68 void InsetHFill::write(Buffer const &, ostream & os) const
69 {
70         os << "\n\\hfill\n";
71 }
72
73
74 bool InsetHFill::isSpace() const
75 {
76         return true;
77 }
78
79
80 } // namespace lyx