1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1998 The LyX Team.
8 * ====================================================== */
13 #pragma implementation
16 #include "insetlist.h"
19 #include "BufferView.h"
21 #include "insets/insettext.h"
22 #include "support/LOstream.h"
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
34 // It is also possible that we will need a baseclass and subclasses for
35 // different types of lists. (and should they be collapsable?)
39 InsetList::InsetList()
43 LyXFont font(LyXFont::ALL_SANE);
46 font.setColor(LColor::footnote);
48 setAutoCollapse(false);
53 void InsetList::Write(Buffer const * buf, ostream & os) const
55 os << getInsetName() << "\n";
56 InsetCollapsable::Write(buf, os);
60 Inset * InsetList::Clone() const
62 InsetList * result = new InsetList;
63 result->inset->init(inset);
65 result->collapsed = collapsed;
70 string const InsetList::EditMessage() const
72 return _("Opened List Inset");
76 int InsetList::Latex(Buffer const * buf,
77 ostream & os, bool fragile, bool fp) const
79 os << "\\footnote{%\n";
81 int i = inset->Latex(buf, os, fragile, fp);
88 bool InsetList::InsertInsetAllowed(Inset * in) const
90 if ((in->LyxCode() == Inset::FOOT_CODE) ||
91 (in->LyxCode() == Inset::MARGIN_CODE)) {