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"
22 #include "insets/insettext.h"
23 #include "support/LOstream.h"
29 // This class is _far_ from finished. I hope that we can have a inset to
30 // handle the different lists that we have. It should also be possible
31 // to create new lists on the fly.
32 // Currently LyX only supports: itemize, enumerate, description and
33 // lyxlist. All support for these should be moved to this class and other
35 // It is also possible that we will need a baseclass and subclasses for
36 // different types of lists. (and should they be collapsable?)
40 InsetList::InsetList()
44 LyXFont font(LyXFont::ALL_SANE);
47 font.setColor(LColor::footnote);
49 setAutoCollapse(false);
54 void InsetList::Write(Buffer const * buf, ostream & os) const
56 os << getInsetName() << "\n";
57 InsetCollapsable::Write(buf, os);
61 Inset * InsetList::Clone() const
63 InsetList * result = new InsetList;
64 result->inset->init(inset);
66 result->collapsed = collapsed;
71 char const * InsetList::EditMessage() const
73 return _("Opened List Inset");
77 int InsetList::Latex(Buffer const * buf,
78 ostream & os, bool fragile, bool fp) const
80 os << "\\footnote{%\n";
82 int i = inset->Latex(buf, os, fragile, fp);
89 bool InsetList::InsertInsetAllowed(Inset * in) const
91 if ((in->LyxCode() == Inset::FOOT_CODE) ||
92 (in->LyxCode() == Inset::MARGIN_CODE)) {
100 LyXFont InsetList::GetDrawFont(BufferView * bv,LyXParagraph * p, int pos) const
102 LyXFont fn = getLyXText(bv)->GetFont(bv->buffer(), p, pos);
103 fn.decSize().decSize();