2003-03-11 13:33:14 +00:00
|
|
|
|
/**
|
2007-04-25 01:24:38 +00:00
|
|
|
|
* \file InsetHFill.cpp
|
2003-03-11 13:33:14 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-03-11 13:33:14 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
|
#include "InsetHFill.h"
|
2006-10-20 16:12:49 +00:00
|
|
|
|
#include "gettext.h"
|
|
|
|
|
|
2003-10-10 21:08:55 +00:00
|
|
|
|
#include "support/std_ostream.h"
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
namespace lyx {
|
2006-10-11 19:40:50 +00:00
|
|
|
|
|
2003-03-11 13:33:14 +00:00
|
|
|
|
using std::ostream;
|
|
|
|
|
|
2003-09-05 09:01:27 +00:00
|
|
|
|
|
2003-03-11 13:33:14 +00:00
|
|
|
|
InsetHFill::InsetHFill()
|
2003-12-11 15:23:15 +00:00
|
|
|
|
: InsetCommand(InsetCommandParams("hfill"), std::string())
|
2003-03-11 13:33:14 +00:00
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
2007-04-29 13:39:47 +00:00
|
|
|
|
std::auto_ptr<Inset> InsetHFill::doClone() const
|
2003-10-28 11:18:40 +00:00
|
|
|
|
{
|
2007-04-29 13:39:47 +00:00
|
|
|
|
return std::auto_ptr<Inset>(new InsetHFill);
|
2003-10-28 11:18:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-11-28 15:15:49 +00:00
|
|
|
|
bool InsetHFill::metrics(MetricsInfo &, Dimension & dim) const
|
2003-10-28 11:18:40 +00:00
|
|
|
|
{
|
|
|
|
|
dim.wid = 3;
|
|
|
|
|
dim.asc = 3;
|
|
|
|
|
dim.des = 3;
|
2006-11-28 15:15:49 +00:00
|
|
|
|
bool const changed = dim_ != dim;
|
2003-11-03 17:47:28 +00:00
|
|
|
|
dim_ = dim;
|
2006-11-28 15:15:49 +00:00
|
|
|
|
return changed;
|
2003-10-28 11:18:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-10-11 19:40:50 +00:00
|
|
|
|
docstring const InsetHFill::getScreenLabel(Buffer const &) const
|
2003-10-28 11:18:40 +00:00
|
|
|
|
{
|
2006-10-20 16:12:49 +00:00
|
|
|
|
return _("Horizontal Fill");
|
2003-10-28 11:18:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-10-19 16:51:30 +00:00
|
|
|
|
int InsetHFill::plaintext(Buffer const &, odocstream & os,
|
2007-02-15 16:07:36 +00:00
|
|
|
|
OutputParams const &) const
|
2003-03-11 13:33:14 +00:00
|
|
|
|
{
|
2007-02-15 16:07:36 +00:00
|
|
|
|
os << " ";
|
|
|
|
|
return 5;
|
2003-03-11 13:33:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-10-19 21:00:33 +00:00
|
|
|
|
int InsetHFill::docbook(Buffer const &, odocstream & os,
|
2003-11-05 12:06:20 +00:00
|
|
|
|
OutputParams const &) const
|
2003-06-07 09:48:11 +00:00
|
|
|
|
{
|
|
|
|
|
os << '\n';
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2003-10-28 11:18:40 +00:00
|
|
|
|
|
2003-08-28 07:41:31 +00:00
|
|
|
|
void InsetHFill::write(Buffer const &, ostream & os) const
|
2003-03-11 13:33:14 +00:00
|
|
|
|
{
|
2004-08-16 11:27:51 +00:00
|
|
|
|
os << "\n\\hfill\n";
|
2003-03-11 13:33:14 +00:00
|
|
|
|
}
|
2004-02-20 10:32:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool InsetHFill::isSpace() const
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|