]> git.lyx.org Git - lyx.git/blob - src/insets/InsetHFill.cpp
Move the findInfo() and defaultCommand() routines out of InsetCommand and into its...
[lyx.git] / src / insets / InsetHFill.cpp
1 /**
2  * \file InsetHFill.cpp
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
22 InsetHFill::InsetHFill()
23         : InsetCommand(InsetCommandParams(HFILL_CODE), std::string())
24 {}
25
26
27 CommandInfo const * InsetHFill::findInfo(std::string const & /* cmdName */)
28 {
29         static const char * const paramnames[] = {""};
30         static const CommandInfo info = {0, paramnames, 0};
31         return &info;
32 }
33
34
35 Inset * InsetHFill::clone() const
36 {
37         return new InsetHFill;
38 }
39
40
41 void InsetHFill::metrics(MetricsInfo &, Dimension & dim) const
42 {
43         dim.wid = 3;
44         dim.asc = 3;
45         dim.des = 3;
46 }
47
48
49 docstring const InsetHFill::getScreenLabel(Buffer const &) const
50 {
51         return _("Horizontal Fill");
52 }
53
54
55 int InsetHFill::plaintext(Buffer const &, odocstream & os,
56                           OutputParams const &) const
57 {
58         os << "     ";
59         return 5;
60 }
61
62
63 int InsetHFill::docbook(Buffer const &, odocstream & os,
64                         OutputParams const &) const
65 {
66         os << '\n';
67         return 0;
68 }
69
70
71 void InsetHFill::write(Buffer const &, std::ostream & os) const
72 {
73         os << "\n\\hfill\n";
74 }
75
76
77 bool InsetHFill::isSpace() const
78 {
79         return true;
80 }
81
82
83 } // namespace lyx