2000-03-08 13:52:57 +00:00
|
|
|
/* This file is part of
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
2000-03-09 23:58:55 +00:00
|
|
|
* Copyright 1998 The LyX Team.
|
2000-03-08 13:52:57 +00:00
|
|
|
*
|
2000-06-28 16:03:01 +00:00
|
|
|
* ======================================================
|
|
|
|
*/
|
2000-03-08 13:52:57 +00:00
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "insetfoot.h"
|
|
|
|
#include "gettext.h"
|
|
|
|
#include "lyxfont.h"
|
|
|
|
#include "BufferView.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"
|
2000-03-08 13:52:57 +00:00
|
|
|
|
2000-04-04 00:19:15 +00:00
|
|
|
using std::ostream;
|
2000-03-08 13:52:57 +00:00
|
|
|
|
2000-07-04 19:16:35 +00:00
|
|
|
|
2000-07-15 23:51:46 +00:00
|
|
|
InsetFoot::InsetFoot()
|
|
|
|
: InsetFootlike()
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-10-10 11:50:43 +00:00
|
|
|
Inset * InsetFoot::Clone(Buffer const &) const
|
2000-03-08 13:52:57 +00:00
|
|
|
{
|
2001-04-02 14:02:58 +00:00
|
|
|
InsetFoot * result = new InsetFoot;
|
|
|
|
result->inset.init(&inset);
|
2000-03-28 16:18:02 +00:00
|
|
|
|
2001-04-02 14:02:58 +00:00
|
|
|
result->collapsed = collapsed;
|
|
|
|
return result;
|
2000-03-08 13:52:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-09-14 17:53:12 +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
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-06-28 16:03:01 +00:00
|
|
|
int InsetFoot::Latex(Buffer const * buf,
|
|
|
|
ostream & os, bool fragile, bool fp) const
|
2000-03-08 13:52:57 +00:00
|
|
|
{
|
2001-04-02 14:02:58 +00:00
|
|
|
os << "\\footnote{%\n";
|
|
|
|
|
|
|
|
int const i = inset.Latex(buf, os, fragile, fp);
|
|
|
|
os << "}%\n";
|
|
|
|
|
|
|
|
return i + 2;
|
2000-03-08 13:52:57 +00:00
|
|
|
}
|
|
|
|
|
2000-03-09 23:58:55 +00:00
|
|
|
|
2000-07-04 11:30:07 +00:00
|
|
|
bool InsetFoot::InsertInsetAllowed(Inset * in) const
|
2000-03-08 13:52:57 +00:00
|
|
|
{
|
2001-04-02 14:02:58 +00:00
|
|
|
if ((in->LyxCode() == Inset::FOOT_CODE) ||
|
|
|
|
(in->LyxCode() == Inset::MARGIN_CODE)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
2000-04-10 14:29:05 +00:00
|
|
|
}
|