9 #include "BufferView.h"
11 #include "frontends/Dialogs.h"
20 string const InsetTOC::getScreenLabel(Buffer const *) const
22 string const cmdname(getCmdName());
24 if (cmdname == "tableofcontents")
25 return _("Table of Contents");
26 return _("Unknown toc list");
30 Inset::Code InsetTOC::lyxCode() const
32 string const cmdname(getCmdName());
33 if (cmdname == "tableofcontents")
34 return Inset::TOC_CODE;
35 return Inset::NO_CODE;
39 void InsetTOC::edit(BufferView * bv, int, int, unsigned int)
41 bv->owner()->getDialogs()->showTOC(this);
45 void InsetTOC::edit(BufferView * bv, bool)
51 int InsetTOC::ascii(Buffer const * buffer, ostream & os, int) const
53 os << getScreenLabel(buffer) << "\n\n";
56 string const cmdname = getCmdName();
57 if (cmdname == "tableofcontents")
59 Buffer::Lists const toc_list = buffer->getLists();
60 Buffer::Lists::const_iterator cit =
62 if (cit != toc_list.end()) {
63 Buffer::SingleList::const_iterator ccit = cit->second.begin();
64 Buffer::SingleList::const_iterator end = cit->second.end();
65 for (; ccit != end; ++ccit)
66 os << string(4 * ccit->depth, ' ')
75 int InsetTOC::linuxdoc(Buffer const *, ostream & os) const
77 if (getCmdName() == "tableofcontents")
83 int InsetTOC::docbook(Buffer const *, ostream & os) const
85 if (getCmdName() == "tableofcontents")