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