1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1998 The LyX Team.
8 * ======================================================
14 #pragma implementation
17 #include "insetnote.h"
21 #include "BufferView.h"
23 #include "insets/insettext.h"
24 #include "support/LOstream.h"
29 void InsetNote::init()
31 LyXFont font(LyXFont::ALL_SANE);
33 font.setColor(LColor::note);
35 setAutoCollapse(false);
41 InsetNote::InsetNote()
47 InsetNote::InsetNote(Buffer const * buf, string const & contents,
49 : InsetCollapsable(collapsed)
53 Paragraph * par = inset.paragraph();
54 Paragraph::size_type pos = 0;
55 buf->insertStringAsLines(par, pos, labelfont, contents);
58 Inset * InsetNote::clone(Buffer const &, bool same_id) const
60 InsetNote * result = new InsetNote;
61 result->inset.init(&inset, same_id);
63 result->collapsed_ = collapsed_;
70 string const InsetNote::editMessage() const
72 return _("Opened Note Inset");
76 void InsetNote::write(Buffer const *buf, ostream & os) const
78 os << getInsetName() << "\n";
79 InsetCollapsable::write(buf, os);