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