]> git.lyx.org Git - features.git/blob - src/insets/InsetFootlike.cpp
InsetIndex: revamp IndexEntry to handle both legacy and modern index insets; simplify...
[features.git] / src / insets / InsetFootlike.cpp
1 /**
2  * \file InsetFootlike.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "InsetFootlike.h"
14
15 #include "Buffer.h"
16 #include "BufferView.h"
17 #include "BufferParams.h"
18 #include "Font.h"
19 #include "MetricsInfo.h"
20
21 #include "support/lstrings.h"
22
23 #include <iostream>
24
25 using namespace std;
26
27 namespace lyx {
28
29 using support::token;
30
31 InsetFootlike::InsetFootlike(Buffer * buf)
32         : InsetCollapsible(buf)
33 {}
34
35
36 void InsetFootlike::write(ostream & os) const
37 {
38         // The layoutName may contain a "InTitle" qualifier
39         os << to_utf8(token(layoutName(), char_type(':'), 0)) << "\n";
40         InsetCollapsible::write(os);
41 }
42
43
44 bool InsetFootlike::insetAllowed(InsetCode code) const
45 {
46         if (code == FOOT_CODE || code == MARGIN_CODE || code == FLOAT_CODE)
47                 return false;
48         return InsetCollapsible::insetAllowed(code);
49 }
50
51
52 } // namespace lyx