2002-09-25 14:26:13 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file insetfoot.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-03-08 13:52:57 +00:00
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
#include "insetfoot.h"
|
|
|
|
|
#include "gettext.h"
|
|
|
|
|
#include "lyxfont.h"
|
|
|
|
|
#include "BufferView.h"
|
2003-05-22 22:44:30 +00:00
|
|
|
|
#include "latexrunparams.h"
|
2000-06-19 15:33:58 +00:00
|
|
|
|
#include "lyxtext.h"
|
2000-07-04 11:30:07 +00:00
|
|
|
|
#include "insets/insettext.h"
|
2000-04-08 17:02:02 +00:00
|
|
|
|
#include "support/LOstream.h"
|
2000-07-04 19:16:35 +00:00
|
|
|
|
#include "debug.h"
|
2002-05-14 14:22:11 +00:00
|
|
|
|
// the following are needed just to get the layout of the enclosing
|
|
|
|
|
// paragraph. This seems a bit too much to me (JMarc)
|
|
|
|
|
#include "lyxlayout.h"
|
|
|
|
|
#include "buffer.h"
|
|
|
|
|
#include "paragraph.h"
|
2000-03-08 13:52:57 +00:00
|
|
|
|
|
2000-07-04 19:16:35 +00:00
|
|
|
|
|
2002-02-16 15:59:55 +00:00
|
|
|
|
using std::ostream;
|
2003-07-25 17:11:25 +00:00
|
|
|
|
using std::auto_ptr;
|
2002-02-16 15:59:55 +00:00
|
|
|
|
|
|
|
|
|
|
2002-03-03 20:25:07 +00:00
|
|
|
|
InsetFoot::InsetFoot(BufferParams const & bp)
|
|
|
|
|
: InsetFootlike(bp)
|
2000-03-08 13:52:57 +00:00
|
|
|
|
{
|
2001-04-02 14:02:58 +00:00
|
|
|
|
setLabel(_("foot"));
|
|
|
|
|
setInsetName("Foot");
|
2000-03-08 13:52:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-05-26 09:13:55 +00:00
|
|
|
|
InsetFoot::InsetFoot(InsetFoot const & in)
|
|
|
|
|
: InsetFootlike(in)
|
2001-07-27 12:03:36 +00:00
|
|
|
|
{
|
|
|
|
|
setLabel(_("foot"));
|
|
|
|
|
setInsetName("Foot");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-07-25 17:11:25 +00:00
|
|
|
|
auto_ptr<InsetBase> InsetFoot::clone() const
|
2001-07-27 12:03:36 +00:00
|
|
|
|
{
|
2003-07-25 17:11:25 +00:00
|
|
|
|
return auto_ptr<InsetBase>(new InsetFoot(*this));
|
2001-07-27 12:03:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-06-28 10:25:20 +00:00
|
|
|
|
string const InsetFoot::editMessage() const
|
2000-03-08 13:52:57 +00:00
|
|
|
|
{
|
2001-04-02 14:02:58 +00:00
|
|
|
|
return _("Opened Footnote Inset");
|
2000-03-08 13:52:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-05-22 22:44:30 +00:00
|
|
|
|
int InsetFoot::latex(Buffer const * buf, ostream & os,
|
2003-05-23 08:59:47 +00:00
|
|
|
|
LatexRunParams const & runparams_in) const
|
2000-03-08 13:52:57 +00:00
|
|
|
|
{
|
2003-05-22 22:44:30 +00:00
|
|
|
|
LatexRunParams runparams = runparams_in;
|
2002-05-14 14:22:11 +00:00
|
|
|
|
if (buf && parOwner()) {
|
2002-06-24 20:28:12 +00:00
|
|
|
|
LyXLayout_ptr const & layout = parOwner()->layout();
|
2003-05-23 09:23:03 +00:00
|
|
|
|
runparams.moving_arg |= layout->intitle;
|
2002-05-14 14:22:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-06-29 14:01:29 +00:00
|
|
|
|
os << "%\n\\footnote{";
|
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
|
|
|
|
|
2001-04-02 14:02:58 +00:00
|
|
|
|
return i + 2;
|
2000-03-08 13:52:57 +00:00
|
|
|
|
}
|
2002-04-03 17:44:05 +00:00
|
|
|
|
|
|
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
|
int InsetFoot::docbook(Buffer const * buf, ostream & os, bool mixcont) const
|
2002-04-03 17:44:05 +00:00
|
|
|
|
{
|
|
|
|
|
os << "<footnote>";
|
2002-06-18 15:44:30 +00:00
|
|
|
|
int const i = inset.docbook(buf, os, mixcont);
|
2002-04-03 17:44:05 +00:00
|
|
|
|
os << "</footnote>";
|
|
|
|
|
|
|
|
|
|
return i;
|
|
|
|
|
}
|