]> git.lyx.org Git - lyx.git/blob - src/insets/insetlist.C
Added copy constructor to inset.h and used it in most insets which permit
[lyx.git] / src / insets / insetlist.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 #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         setAutoCollapse(false);
49         setInsetName("List");
50 }
51
52
53 void InsetList::write(Buffer const * buf, ostream & os) const
54 {
55         os << getInsetName() << "\n";
56         InsetCollapsable::write(buf, os);
57 }
58
59
60 string const InsetList::editMessage() const
61 {
62         return _("Opened List Inset");
63 }
64
65
66 int InsetList::latex(Buffer const * buf,
67                      ostream & os, bool fragile, bool fp) const
68 {
69         os << "\\footnote{%\n";
70         
71         int i = inset.latex(buf, os, fragile, fp);
72         os << "}%\n";
73         
74         return i + 2;
75 }