]> git.lyx.org Git - lyx.git/blob - src/insets/insethfill.C
Use the new InsetCommandParams interface (inset part), from Ugras and me
[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
15 #include "gettext.h"
16
17 #include "support/std_ostream.h"
18
19 using lyx::docstring;
20 using lyx::odocstream;
21
22 using std::ostream;
23
24
25 InsetHFill::InsetHFill()
26         : InsetCommand(InsetCommandParams("hfill"), std::string())
27 {}
28
29
30 std::auto_ptr<InsetBase> InsetHFill::doClone() const
31 {
32         return std::auto_ptr<InsetBase>(new InsetHFill);
33 }
34
35
36 void InsetHFill::metrics(MetricsInfo &, Dimension & dim) const
37 {
38         dim.wid = 3;
39         dim.asc = 3;
40         dim.des = 3;
41         dim_ = dim;
42 }
43
44
45 docstring const InsetHFill::getScreenLabel(Buffer const &) const
46 {
47         return _("Horizontal Fill");
48 }
49
50
51 int InsetHFill::latex(Buffer const &, odocstream & os,
52                       OutputParams const &) const
53 {
54         os << getCommand() << "{}";
55         return 0;
56 }
57
58
59 int InsetHFill::plaintext(Buffer const &, odocstream & os,
60                       OutputParams const &) const
61 {
62         os << '\t';
63         return 0;
64 }
65
66
67 int InsetHFill::docbook(Buffer const &, odocstream & os,
68                         OutputParams const &) const
69 {
70         os << '\n';
71         return 0;
72 }
73
74
75 void InsetHFill::write(Buffer const &, ostream & os) const
76 {
77         os << "\n\\hfill\n";
78 }
79
80
81 bool InsetHFill::isSpace() const
82 {
83         return true;
84 }