2002-09-25 14:26:13 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file insetmarginal.C
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:09:55 +00:00
|
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
2002-03-21 17:09:55 +00:00
|
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS
|
2000-06-28 16:03:01 +00:00
|
|
|
|
*/
|
2000-06-26 18:48:45 +00:00
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "insetmarginal.h"
|
|
|
|
|
#include "gettext.h"
|
|
|
|
|
#include "lyxfont.h"
|
|
|
|
|
#include "BufferView.h"
|
|
|
|
|
#include "lyxtext.h"
|
2000-07-04 11:30:07 +00:00
|
|
|
|
#include "insets/insettext.h"
|
2000-06-26 18:48:45 +00:00
|
|
|
|
#include "support/LOstream.h"
|
2000-07-04 19:16:35 +00:00
|
|
|
|
#include "debug.h"
|
2000-06-26 18:48:45 +00:00
|
|
|
|
|
|
|
|
|
|
2002-02-16 15:59:55 +00:00
|
|
|
|
using std::ostream;
|
|
|
|
|
|
|
|
|
|
|
2002-03-03 20:25:07 +00:00
|
|
|
|
InsetMarginal::InsetMarginal(BufferParams const & bp)
|
|
|
|
|
: InsetFootlike(bp)
|
2000-06-28 13:35:52 +00:00
|
|
|
|
{
|
2000-07-04 19:16:35 +00:00
|
|
|
|
setLabel(_("margin"));
|
|
|
|
|
setInsetName("Marginal");
|
2000-06-28 13:35:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-05-26 09:13:55 +00:00
|
|
|
|
InsetMarginal::InsetMarginal(InsetMarginal const & in)
|
|
|
|
|
: InsetFootlike(in)
|
2001-07-27 12:03:36 +00:00
|
|
|
|
{
|
|
|
|
|
setLabel(_("margin"));
|
|
|
|
|
setInsetName("Marginal");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-06-03 15:10:14 +00:00
|
|
|
|
Inset * InsetMarginal::clone() const
|
2001-07-27 12:03:36 +00:00
|
|
|
|
{
|
2003-05-28 23:09:16 +00:00
|
|
|
|
return new InsetMarginal(*this);
|
2001-07-27 12:03:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-06-28 10:25:20 +00:00
|
|
|
|
string const InsetMarginal::editMessage() const
|
2000-06-26 18:48:45 +00:00
|
|
|
|
{
|
2000-07-04 19:16:35 +00:00
|
|
|
|
return _("Opened Marginal Note Inset");
|
2000-06-26 18:48:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-05-22 22:44:30 +00:00
|
|
|
|
int InsetMarginal::latex(Buffer const * buf, ostream & os,
|
2003-05-23 08:59:47 +00:00
|
|
|
|
LatexRunParams const & runparams) const
|
2000-06-26 18:48:45 +00:00
|
|
|
|
{
|
2001-06-29 14:01:29 +00:00
|
|
|
|
os << "%\n\\marginpar{";
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2003-05-23 08:59:47 +00:00
|
|
|
|
int const i = inset.latex(buf, os, runparams);
|
2001-06-29 14:01:29 +00:00
|
|
|
|
os << "%\n}";
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2000-07-15 23:51:46 +00:00
|
|
|
|
return i + 2;
|
2000-06-26 18:48:45 +00:00
|
|
|
|
}
|