]> git.lyx.org Git - lyx.git/blob - src/insets/insetlist.C
Enable the external inset to handle unknown templates gracefully.
[lyx.git] / src / insets / insetlist.C
1 /**
2  * \file insetlist.C
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 #include <config.h>
11
12
13 #include "insetlist.h"
14 #include "gettext.h"
15 #include "lyxfont.h"
16 #include "BufferView.h"
17 #include "lyxtext.h"
18 #include "insets/insettext.h"
19 #include "support/LOstream.h"
20 #include "debug.h"
21
22 using std::ostream;
23 using std::endl;
24
25 // This class is _far_ from finished. I hope that we can have a inset to
26 // handle the different lists that we have. It should also be possible
27 // to create new lists on the fly.
28 // Currently LyX only supports: itemize, enumerate, description and
29 // lyxlist. All support for these should be moved to this class and other
30 // helper classes.
31 // It is also possible that we will need a baseclass and subclasses for
32 // different types of lists. (and should they be collapsable?)
33 //
34 // Lgb
35
36 InsetList::InsetList()
37         : InsetCollapsable()
38 {
39         setLabel(_("list"));
40         LyXFont font(LyXFont::ALL_SANE);
41         font.decSize();
42         font.decSize();
43         font.setColor(LColor::collapsable);
44         setLabelFont(font);
45 #if 0
46         setAutoCollapse(false);
47 #endif
48         setInsetName("List");
49 }
50
51
52 void InsetList::write(Buffer const * buf, ostream & os) const
53 {
54         os << getInsetName() << "\n";
55         InsetCollapsable::write(buf, os);
56 }
57
58
59 string const InsetList::editMessage() const
60 {
61         return _("Opened List Inset");
62 }
63
64
65 int InsetList::latex(Buffer const * buf, ostream & os,
66                      LatexRunParams const & runparams) const
67 {
68         os << "\\footnote{%\n";
69
70         int i = inset.latex(buf, os, runparams);
71         os << "}%\n";
72
73         return i + 2;
74 }