2001-07-20 09:57:23 +00:00
|
|
|
/* This file is part of
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
|
|
|
* Copyright 1998 The LyX Team.
|
|
|
|
*
|
|
|
|
* ======================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "insetnote.h"
|
|
|
|
#include "gettext.h"
|
|
|
|
#include "lyxfont.h"
|
|
|
|
#include "BufferView.h"
|
|
|
|
#include "lyxtext.h"
|
|
|
|
#include "insets/insettext.h"
|
|
|
|
#include "support/LOstream.h"
|
|
|
|
#include "debug.h"
|
|
|
|
|
|
|
|
using std::ostream;
|
|
|
|
|
|
|
|
InsetNote::InsetNote()
|
|
|
|
: InsetCollapsable()
|
|
|
|
{
|
|
|
|
LyXFont font(LyXFont::ALL_SANE);
|
|
|
|
font.decSize();
|
|
|
|
font.setColor(LColor::note);
|
|
|
|
setLabelFont(font);
|
|
|
|
setAutoCollapse(true);
|
|
|
|
|
|
|
|
setLabel(_("note"));
|
|
|
|
setInsetName("Note");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Inset * InsetNote::clone(Buffer const &, bool same_id) const
|
|
|
|
{
|
|
|
|
InsetNote * result = new InsetNote;
|
|
|
|
result->inset.init(&inset, same_id);
|
|
|
|
|
|
|
|
result->collapsed_ = collapsed_;
|
|
|
|
if (same_id)
|
|
|
|
result->id_ = id_;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
string const InsetNote::editMessage() const
|
|
|
|
{
|
|
|
|
return _("Opened Note Inset");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void InsetNote::write(Buffer const *buf, ostream & os) const
|
|
|
|
{
|
2001-07-20 12:40:38 +00:00
|
|
|
os << getInsetName() << "\n";
|
2001-07-20 09:57:23 +00:00
|
|
|
InsetCollapsable::write(buf, os);
|
|
|
|
}
|