]> git.lyx.org Git - lyx.git/blob - src/insets/insetnote.C
c09db364ae5616888d03806bd6a7f39eefe2d8a6
[lyx.git] / src / insets / insetnote.C
1 /**
2  * \file insetnote.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Angus Leeming
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #include <config.h>
12
13
14 #include "insetnote.h"
15 #include "gettext.h"
16 #include "lyxfont.h"
17 #include "language.h"
18 #include "buffer.h"
19 #include "BufferView.h"
20 #include "lyxtext.h"
21 #include "insets/insettext.h"
22 #include "support/LOstream.h"
23 #include "support/lstrings.h"
24 #include "debug.h"
25
26 using std::ostream;
27
28
29 void InsetNote::init()
30 {
31         LyXFont font(LyXFont::ALL_SANE);
32         font.decSize();
33         font.decSize();
34         font.setColor(LColor::note);
35         setLabelFont(font);
36         setBackgroundColor(LColor::notebg);
37         setLabel(_("note"));
38         setInsetName("Note");
39 }
40
41
42 InsetNote::InsetNote(BufferParams const & bp)
43         : InsetCollapsable(bp)
44 {
45         init();
46 }
47
48
49 InsetNote::InsetNote(InsetNote const & in)
50         : InsetCollapsable(in)
51 {
52         init();
53 }
54
55
56 // InsetNote::InsetNote(InsetNote const & in, bool same_id)
57 //      : InsetCollapsable(in, same_id)
58 // {
59 //      init();
60 // }
61
62
63 Inset * InsetNote::clone(Buffer const &) const
64 {
65         return new InsetNote(*const_cast<InsetNote *>(this));
66 }
67
68
69 // Inset * InsetNote::clone(Buffer const &, bool same_id) const
70 // {
71 //      return new InsetNote(*const_cast<InsetNote *>(this), same_id);
72 // }
73
74
75 string const InsetNote::editMessage() const
76 {
77         return _("Opened Note Inset");
78 }
79
80
81 void InsetNote::write(Buffer const * buf, ostream & os) const
82 {
83         os << getInsetName() << "\n";
84         InsetCollapsable::write(buf, os);
85 }