]> git.lyx.org Git - lyx.git/blob - src/insets/insetmarginal.C
change a lot of methods to begin with small char
[lyx.git] / src / insets / insetmarginal.C
1 /* This file is part of
2  * ======================================================
3  * 
4  *           LyX, The Document Processor
5  *       
6  *          Copyright 1998 The LyX Team.
7  *
8  * ======================================================
9  */
10
11 #include <config.h>
12
13 #ifdef __GNUG__
14 #pragma implementation
15 #endif
16
17 #include "insetmarginal.h"
18 #include "gettext.h"
19 #include "lyxfont.h"
20 #include "BufferView.h"
21 #include "lyxtext.h"
22 #include "insets/insettext.h"
23 #include "support/LOstream.h"
24 #include "debug.h"
25
26
27 InsetMarginal::InsetMarginal()
28         : InsetFootlike()
29 {
30         setLabel(_("margin"));
31         setInsetName("Marginal");
32 }
33
34
35 Inset * InsetMarginal::clone(Buffer const &) const
36 {
37         InsetMarginal * result = new InsetMarginal;
38         result->inset.init(&inset);
39         
40         result->collapsed = collapsed;
41         return result;
42 }
43
44
45 string const InsetMarginal::editMessage() const
46 {
47         return _("Opened Marginal Note Inset");
48 }
49
50
51 int InsetMarginal::latex(Buffer const * buf,
52                          std::ostream & os, bool fragile, bool fp) const
53 {
54         os << "\\marginpar{%\n";
55         
56         int const i = inset.latex(buf, os, fragile, fp);
57         os << "}%\n";
58         
59         return i + 2;
60 }
61
62
63 bool InsetMarginal::insertInsetAllowed(Inset * in) const
64 {
65         if ((in->lyxCode() == Inset::FOOT_CODE) ||
66             (in->lyxCode() == Inset::MARGIN_CODE)) {
67                 return false;
68         }
69         return true;
70 }