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